Discussion Locked

prompt for password in linux single user

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

My question is:sir,
i want to ask password in single user mode in linux.I know that we can do with "restricted password="somestring" in lilo.conf.But i don't want this.The system should start in single use mode and start all the services and the system should ask password before that bash prompt ......

7 replies

by kainx (mej

RedHat uses a utility called "sulogin" to accomplish this. Booting into single-user mode causes sulogin to run; sulogin prompts for the root password before allowing the user to login.

However, this is easily defeated using "linux init=/bin/sh" instead of "linux single". In order to keep someone with physical access to the box from breaking in, you would need a password-protected boot loader on a system with no CD or floppy drive.

Note that very few services are started when a system isbooted into single-user mode. It occurs to me that perhaps what you really want is multi-user mode with text-only logins, not single-user mode. On RedHat and variants, this is runlevel 3. (Select it with "linux 3" at the lilo prompt, or by specifying "3" in the initdefault line of /etc/inittab.)

by kainx (mej

The file is in /sbin/sulogin and is supplied by the SysVinit package in RedHat. If you are not running RedHat, this file may not exist for you.

Try to clarify exactly what you're asking for. I'm still not convinced that you aren't simply looking for text console login.

This discussion is closed to new replies.