sudo chroot /tmp/jail /bin/echo 'test' > /home/someone/.bash_history
错误日志: -bash:/home/someone/.bash_history:权限被拒绝
答案 0 :(得分:1)
你没有用sudo运行整个命令。尝试
sudo sh -c "chroot /tmp/jail /bin/echo 'test' > /home/someone/.bash_history"
重定向后的部分不是以root身份运行
更多示例
How do I use sudo to redirect output to a location I don't have permission to write to?