
#Sudo vs su root password
An extra local user, or an enabled root password is needed here. This tends to leave the system unusable unless cracked. To setup a workstation, or fix it, in the case of a network failure where nss-ldap is broken, root is required. All other users are imported using NSS techniques such as nss-ldap.

You could also pass the whole command to a shell process run under sudo to have the file written to with root permissions, such as sudo sh -c "ls > /root/somefile" To append, or ls | sudo tee /root/somefile You can use ls | sudo tee -a /root/somefile For instance consider sudo ls > /root/somefile will not work since it is the shell that sets up the redirections that tries to write to that file, not the command being run with root permission. Redirecting the output of commands run with sudo requires aĭifferent approach. The authentication automatically expires after a short time (whichĬan be set to as little as desired or 0) so if you walk away from the terminal after running commands as root using sudo, you will not be leaving a root terminal open indefinitely.Īlthough for desktops the benefits of using sudo are great, there are possible issues which need to be noted:.The root account password does not need to be shared with everybody who needs to perform some type of administrative task(s) on the system (see the previous bullet).sudo can be setup with a much more fine-grained security policy.

When you use a single root password, the only way to de-authorize users is to change the root password.
#Sudo vs su root crack
Since the root account password is locked, this attack becomes essentially meaningless, since there is no password to crack or guess in the first place. What they don't know is what the usernames of your other users are.
#Sudo vs su root cracker
On a server, every cracker trying to brute-force their way in will know it has an account named root and will try that first.

If you mess up, you can go back and see what commands were run.

You maybe noticed that the corrupted $PATH variable was not reset. Wow! Thanks, super admin! $ ls -l /tmp/shadow_copy If your admin isn't that smart or just a bit lazy, he might come to your desk and try with his super-user powers: $ su Now, you ask your admin why you can't cat the dummy file in your home folder, it just won't work! $ ls -l /home/you/dummy_file
#Sudo vs su root software
Imagine, you're a software developer with normal user access to a machine and your ignorant admin just won't give you root access. Su just switches the user, providing a normal shell with an environment nearly the same as with the old user. A login shell resets most environment variables, providing a clean base. Su - invokes a login shell after switching the user.
