LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   SU command doesn't work properly (https://www.linuxquestions.org/questions/linux-newbie-8/su-command-doesnt-work-properly-885232/)

z99 06-08-2011 11:21 AM

SU command doesn't work properly
 
hi everyone,
i install fedora 15,and today when i was trying to become root,it asked for password and then i confront with:
Code:

[majid@Fedora ~]$ su
Password:
bash-4.2#

thanks in advance

TobiSGD 06-08-2011 11:25 AM

And what is the problem? Aren't you root now (check that with whoami)?

szboardstretcher 06-08-2011 11:29 AM

The "#" usually means that you are root.

But, if you want the environment settings to run, like changing the prompt, then you will need to do:

Code:

su -
Instead.

z99 06-08-2011 12:28 PM

@TobiSGD,yes i am root,sorry
but @szboardstretcher i did su - but my prompt does not change
but how can i change my prompt?
thank you guys

TobiSGD 06-08-2011 12:33 PM

http://tldp.org/HOWTO/Bash-Prompt-HOWTO/

roygbiiv 06-08-2011 02:23 PM

Quote:

Originally Posted by z99 (Post 4380113)
but how can i change my prompt?
thank you guys

Either copy your own ~/.bashrc to /root/ or copy /etc/skel/.bashrc to /root/, and then edit it for your purpose.

Sjonnie48 06-08-2011 02:44 PM

To change your prompt temporarily: PS1=& will change your prompt in &. Also the usual prefix will disappear, giving a command line that only shows the prompt of your choice.
Example:
Code:

root@server:~# PS1=#
#



All times are GMT -5. The time now is 03:22 AM.