LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Change login text? (https://www.linuxquestions.org/questions/linux-newbie-8/change-login-text-584539/)

vbdeveloper 09-13-2007 08:14 PM

Change login text?
 
I want to change the login prompt from "slackware login" to
just "login"?
Thanks in advance for your help.

Scroggs79 09-14-2007 01:15 AM

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

vbdeveloper 09-14-2007 04:18 AM

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"?

Poetics 09-14-2007 01:14 PM

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.

btmiller 09-14-2007 08:07 PM

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:

Code:

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:


Code:

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.


All times are GMT -5. The time now is 11:03 PM.