how to set up su message
Hello,
I would like to set up su message on my linux machine, I'm running archlinux. This is an example of what I want: user@machine:su password:****** Super user mode is enabled root@machine: |
how about this:
Code:
sudo bash |
This would only invoke bash with root. I checked man pages of bash, but it doesn't seem to be anything in there or maybe i just couldn't see it.
|
don't know if there is a dedicated place for doing this, but it should probably be possible to do this through a bash function? (so a function in your .bashrc) something like this (not on Linux now so can't test it):
Code:
function su() { |
I don't think that will work, as the echo statement will only be executed once su has finished.
|
Quote:
|
I'm sorry, maybe I did not make it clear, what I need, at that moment when I log in as superuser, I want a message to be prompted, how can I add or edit that message?
|
many people set up something like this through their bash prompt. so for example your regular prompt would be this:
name@linuxbox $ and your root prompt would be this: name@linuxbox # when you add colors, put the root one in red so it distinguishes itself. i know this is not what you are asking, but it accomplishes the same goal. |
In the file /root/.bashrc add a line:
echo Super user mode is enabled!!!!!!!!1 |
Thanx, that worked. P.S. I had to create that file myself, it wasn't there
|
Quote:
The .bashrc file is optional. It's handy to have one and put aliases and things in there. For example, you could put alias ll="ls -la" |
Quote:
|
All times are GMT -5. The time now is 09:50 AM. |