LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-30-2011, 01:18 AM   #1
Timothy.u
Member
 
Registered: Aug 2011
Location: Lithuania
Distribution: Slackware, Debian, Archlinux
Posts: 44

Rep: Reputation: Disabled
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:
 
Old 09-30-2011, 03:20 AM   #2
16pide
Member
 
Registered: Jan 2010
Posts: 418

Rep: Reputation: 83
how about this:
Code:
sudo bash
 
Old 09-30-2011, 04:02 AM   #3
Timothy.u
Member
 
Registered: Aug 2011
Location: Lithuania
Distribution: Slackware, Debian, Archlinux
Posts: 44

Original Poster
Rep: Reputation: Disabled
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.
 
Old 09-30-2011, 04:25 AM   #4
rhowaldt
LQ Newbie
 
Registered: Jun 2011
Location: Netherlands
Distribution: #! (crunchbang)
Posts: 5

Rep: Reputation: Disabled
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() {
   su
   echo "Superuser mode is enabled"
}
 
Old 09-30-2011, 04:31 AM   #5
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
I don't think that will work, as the echo statement will only be executed once su has finished.
 
Old 09-30-2011, 04:51 AM   #6
zk1234
4MLinux Maintainer
 
Registered: Oct 2010
Location: Poland
Distribution: 4MLinux, Slackware
Posts: 640

Rep: Reputation: 133Reputation: 133
Quote:
Originally Posted by Timothy.u View Post
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:
I think there is a small mishmash in your question. If you want to enable super user mode permanently than you should just log in as root. The su command has been created to execute something as root, but without permanent enabling su mode.
 
Old 09-30-2011, 05:08 AM   #7
Timothy.u
Member
 
Registered: Aug 2011
Location: Lithuania
Distribution: Slackware, Debian, Archlinux
Posts: 44

Original Poster
Rep: Reputation: Disabled
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?
 
Old 09-30-2011, 05:15 AM   #8
rhowaldt
LQ Newbie
 
Registered: Jun 2011
Location: Netherlands
Distribution: #! (crunchbang)
Posts: 5

Rep: Reputation: Disabled
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.
 
Old 09-30-2011, 05:17 AM   #9
snooly
Member
 
Registered: Sep 2011
Posts: 124

Rep: Reputation: Disabled
In the file /root/.bashrc add a line:

echo Super user mode is enabled!!!!!!!!1
 
Old 09-30-2011, 05:20 AM   #10
Timothy.u
Member
 
Registered: Aug 2011
Location: Lithuania
Distribution: Slackware, Debian, Archlinux
Posts: 44

Original Poster
Rep: Reputation: Disabled
Thanx, that worked. P.S. I had to create that file myself, it wasn't there
 
Old 09-30-2011, 08:36 PM   #11
snooly
Member
 
Registered: Sep 2011
Posts: 124

Rep: Reputation: Disabled
Quote:
Originally Posted by Timothy.u View Post
Thanx, that worked. P.S. I had to create that file myself, it wasn't there

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"
 
Old 10-02-2011, 11:57 PM   #12
Timothy.u
Member
 
Registered: Aug 2011
Location: Lithuania
Distribution: Slackware, Debian, Archlinux
Posts: 44

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by snooly View Post
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"
Yeah, I checked out ordinary users .bashcr and I found a lot of interesting stuff there
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Netqmail-1.06.. how to set max. recipient per message Winanjaya Linux - Server 3 07-08-2010 04:21 AM
set .mailrc to get server down message on pager livetoday20 Linux - Newbie 2 03-04-2008 10:57 AM
How to set up a message board on Slackware. Posty Slackware 3 01-31-2004 12:21 PM
set up a welcome message on my linux box hamish Red Hat 2 10-10-2003 08:18 PM
getting message to set environmet variable mr.moto Linux - General 2 01-15-2002 09:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration