- 注:只是其中一个原因
- Linux 在其他用户下,使用sudo 命令创建文件,sudo touch 1.txt
[go_test@localhost ~]$ sudo touch 1.txt [sudo] go_test 的密码: go_test 不在 sudoers 文件中。此事将被报告。解决方法
- 文件/etc/sudoers 添加命令
username ALL=(ALL) ALL - 注意:该文件是只读模式。需要先Esc 退出编辑模式,在输入强制保存命名::wq!
- 测试,可以创建文件。

[go_test@localhost ~]$ sudo touch 1.txt [sudo] go_test 的密码: go_test 不在 sudoers 文件中。此事将被报告。解决方法