How to change to normal user in the command line when logged in as the root user?
I log into an system as root via ssh.
How do I become the normal user or another user in the command-line?
yes please avoid ssh'ing directly to root. as to why read http://unix.stackexchange.com/questions/82626/why-is-root-login-via-ssh-so-bad-that-everyone-advises-to-disable-it
One of the features of Linux is the ability to change userid when logged into a system. This command su is sometimes referred to as superuser , however this is not completely correct. In the early days of UNIX it was only possible to change to the root user, which made for the superuser command however it is now possible to change to any user using the su command. It is more correct to refer to the command as the switch user command.
The switch user command
suis used to change between different users on a system, without having to logout. The most common use is to to change to the root user, but it can be used to switch to any user depending upon the users settings. To switch to a different user other than root, then the username is used as the last option on the command.
It is also possible to change to another user by putting the username after the
sucommand. There are two ways of switching users. By putting a '-' after the command will cause the users profile to be read and variables to be set. Without the '-' the previous users settings will still remain.
To use the new users profile and variables
su - username
To continue with the current profile and variables
you can then return to the previous user by entering
-Always Take the issue of safety first, so the same would be correct to disconnect and return the system to the correct user, the 'su' command will not le give the desired security for the system because you still remain as' Root 'and even security must want to leave this user and return to the correct user.
@PauloMaia I don't understand what you mean? Did you read the question? I just want to change from `root` to normal-user on a system which I have and active terminal session running. This question got alot of down-votes so I found out how to do it and this answers my question. It's simple `su` lets me change users and your not the first to mention security which I still don't understand the relevance to this.