3 ms·
I thought "sudo -s" was the correct way to drop into a root user shell.
by Osiris 14y ago
I thought "sudo -s" was the correct way to drop into a root user shell.
- ralph 14y agoNo, unless one understands the subtleties, it may be best to use -i. $ sudo -s $ pwd /home/ralph $ exit $ sudo -i root@orac:~# pwd /root root@orac:~# logout $ $ sudo strace -fe execve sudo -s execve("/usr/bin/sudo", ["sudo", "-s"], [/* 16 vars */]) = 0 execve("/bin/bash", ["/bin/bash"], [/* 16 vars */]) = 0 ... $ exit $ sudo strace -fe execve sudo -i execve("/usr/bin/sudo", ["sudo", "-i"], [/* 16 vars */]) = 0 execve("/bin/bash", ["-bash"], [/* 16 vars */]) = 0 ... root@orac:~# logout $