Terminal Auto Login by root Without any X?

General support questions
Post Reply
mbzadegan
Posts: 1
Joined: 2018/02/07 09:45:05

Terminal Auto Login by root Without any X?

Post by mbzadegan » 2018/02/07 09:48:52

Hi everybody,
How can I auto login by root after every boot? BTW, I have not any X installed.

Whoever
Posts: 1024
Joined: 2013/09/06 03:12:10

Re: Terminal Auto Login by root Without any X?

Post by Whoever » 2018/02/08 06:06:59

Why do you want to do this?

poky
Posts: 91
Joined: 2013/03/27 12:18:03

Re: Terminal Auto Login by root Without any X?

Post by poky » 2018/02/08 18:16:08

File /etc/init/start-ttys.override:

Code: Select all

#
# This service starts the configured number of gettys.
#
# Do not edit this file directly. If you want to change the behaviour,
# please create a file start-ttys.override and put your changes there.
#
start on stopped rc RUNLEVEL=[2345]
env ACTIVE_CONSOLES=/dev/tty[1-6]
env E_TTY=/dev/tty1
task
script
    . /etc/sysconfig/init
    for tty in $(echo $ACTIVE_CONSOLES) ; do
        if [ "$tty" = "$E_TTY" ]; then
        initctl start ttyautologin TTY=$tty
        else
        initctl start tty TTY=$tty
fi
done
end script
File /etc/init/ttyautologin.conf:

Code: Select all

# tty - getty
#
# This service maintains a getty on the specified device.

stop on runlevel [S016]
respawn
instance $TTY
exec /sbin/mingetty --delay=10 --autologin root $TTY

Post Reply