Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 09-13-2007, 09:14 PM   #1
LQ Newbie
Registered: Sep 2007
Posts: 4

Rep: Reputation: 0
Change login text?

I want to change the login prompt from "slackware login" to
just "login"?
Thanks in advance for your help.
Old 09-14-2007, 02:15 AM   #2
LQ Newbie
Registered: Feb 2006
Location: California
Distribution: Mandriva
Posts: 15

Rep: Reputation: 0
Check out the file /etc/issue

I believe mingetty displays the file as a login prompt (see /etc/inittab)

You might find /etc/motd (message of the day) useful
Old 09-14-2007, 05:18 AM   #3
LQ Newbie
Registered: Sep 2007
Posts: 4

Original Poster
Rep: Reputation: 0
I looked, none of these files contain the word "slckware".
Try typing the "login" command, you will get a prompt
"slackware login:" where is this "slackware" coming from,
is it compiled into the "login" command? Any ideas where
I find the source code for "login"?
Old 09-14-2007, 02:14 PM   #4
Senior Member
Registered: Jun 2003
Location: California
Distribution: Slackware
Posts: 1,181

Rep: Reputation: 49
Slackware adds the hostname before the login prompt -- the default I believe is "darkstar login:" Unfortunately I don't know where to specifically change the text, but that's why you're seeing 'Slackware' there.
Old 09-14-2007, 09:07 PM   #5
Senior Member
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
If you use (or can use) mgetty or getty as your getty program, you can customize the login: prompt with the -p option (strangely mingetty seems to be missing an analogous option). The default I believe is to print out <hostname> login:. Since the default Slackware hostname is darkstar that's why you see darkstar login:. Most other distros use localhost by default so you'll see localhost login:.

To change it, edit /etc/inittab and change the mgetty or getty lines from:

1:2345:respawn:/sbin/mgetty tty1
2:2345:respawn:/sbin/mgetty tty2
3:2345:respawn:/sbin/mgetty tty3
4:2345:respawn:/sbin/mgetty tty4
5:2345:respawn:/sbin/mgetty tty5
6:2345:respawn:/sbin/mgetty tty6
To something like:

1:2345:respawn:/sbin/mgetty -p 'My cool prompt: ' tty1
2:2345:respawn:/sbin/mgetty -p 'My cool prompt: ' tty2
3:2345:respawn:/sbin/mgetty -p 'My cool prompt: ' tty3
4:2345:respawn:/sbin/mgetty -p 'My cool prompt: ' tty4
5:2345:respawn:/sbin/mgetty -p 'My cool prompt: ' tty5
6:2345:respawn:/sbin/mgetty -p 'My cool prompt: ' tty6
A couple of caveats:

(1) You must reboot for this to take effect.

(2) Editing /etc/inittab is dangerous and you will break your system if you make a mistake or something doesn't work right. Always make a back up copy of inittab and be confident in your ability to boot off a rescue CD to copy the back-up back into place if something goes badly wrong. Messing up inittab can render a system non-bootable, which is why it is important to take these precautions before editing it.

(3) Ubuntu and other systems that use non-standard inits such as init-ng will have different ways to configure this. For instance on *buntu the getty start up commands are stored in the /etc/events.d/tty[1-6] files.


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
How change text color using linux in text mode only runlevel 3? Xavius Linux - General 7 05-07-2009 03:19 AM
how to change some text of a certain line of a text file with bash and *nix scripting alred Programming 6 07-10-2006 12:55 PM
How to find and change a specific text in a text file by using shell script Bassam Programming 1 07-18-2005 08:15 PM
Change Graphical to Text Login bigrig2004 Linux - Hardware 2 12-22-2004 05:44 PM
How to change the text message on the login page? mrodriguez Linux - Newbie 2 11-25-2004 03:40 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:26 PM.

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