![]() ![]() If you have to use su, then always use it like su - to make sure everything is sourced as it should be and nothing has been compromised with. ![]() sudo -i passwd OR set a password for root user in a single go: sudo passwd root Test it your root password by typing the following command. We can setup our /etc/sudoers file then use something like: sudo -i -u username As a result, you can not login using root user or use a command such as ‘su -‘ to become a SuperUser. It's not a good idea to share a single password between users, so it's best to not use su at all, instead we can use sudo, also there is no need to run something like: sudo su - username You will get a login shell with the target user access.You're using your own password to run the su command as root (if you're permitted to).You will be dropped into a non-login shell (things like.The prompt will change from to, indicating you have root access. Your working directory will be /root, and it will read roots. Unlike the command su, users supply their personal password to sudo (if necessary) rather than that of the superuser or other account. You have to provide the target user's password su is equivalent to sudo -i and simulates a login into the root account.The other difference is using - with su it will switches to the user while running a login shell, without the - you will get a non-login shell. The -S switch makes sudo read the password from STDIN. ![]() First of all using su username you have to provide the password of "username" to be able to switch into its account while with sudo su - username for a second with your own password you will become root, then without using any other password you are running the su - uesrname to switch into the "username". ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |