GOOGLE Search

Google
 

Tuesday, March 18, 2008

Linux Tip No. 29: Becoming a Super User

Becoming Super User (The su Command)

[docadmin@mail ~]$ su
Password: ******
[root@mail docadmin]#

When you are prompted, type in the root user's password. The prompt for the regular user ($) will be changed to the super user prompt (#). At this point, you have full permission to run any command and use any file on the system. However, one thing that the su command doesn't do when used this way is read in the root user's environment. As a result, you may type a command that you know is available and get the message "command not found." To fix this problem, you can use the su command with the dash (-) option instead, as follows:

[docadmin@mail ~]$ su -
Password:
[root@mail docadmin]#




When you are prompted, type in the root user's password. The prompt for the regular user ($) will be changed to the super user prompt (#). At this point, you have full permission to run any command and use any file on the system. However, one thing that the su command doesn't do when used this way is read in the root user's environment. As a result, you may type a command that you know is available and get the message "command not found." To fix this problem, you can use the su command with the dash (-) option instead, as follows:

$ su -
Password: ******
#




No comments: