Ion*_*zău 3 users root sudo privileges
假设机器有两个用户:
当 Bob 登录时,Alice 如何修改根文件(即使有 ,Bob 也没有这个权限sudo)?
爱丽丝尝试:
$ sudo vim /etc/hosts
[sudo] password for Bob:
Bob is not in the sudoers file. This incident will be reported.
Run Code Online (Sandbox Code Playgroud)
ene*_*dil 13
使用su:
su - alice
sudo vim /etc/hosts
Run Code Online (Sandbox Code Playgroud)
来自man su:
The su command is used to become another user during a login session.
Invoked without a username, su defaults to becoming the superuser. The
optional argument - may be used to provide an environment similar to
what the user would expect had the user logged in directly.
Run Code Online (Sandbox Code Playgroud)
有关更多信息,请参阅
man su
Run Code Online (Sandbox Code Playgroud)
和维基百科。