User Tools

Site Tools


to_auto-login_in_centos

Following are the steps to enable automatic user login in RHEL7:

Remove the original getty@tty1.service symlink:

  [root@host]#  rm /etc/systemd/system/getty.target.wants/getty@tty1.service

Make a copy of the getty@.service file and name it getty@tty1.service:

  [root@host]# cp /lib/systemd/system/getty@.service /etc/systemd/system/getty@tty1.service

Open /etc/systemd/system/getty@tty1.service file using text editor and edit ExecStart values like this (the last line, must be ADDED):

  [root@host]# vim /etc/systemd/system/getty@tty1.service
  [Service]
  ...
  ExecStart=-/sbin/agetty --autologin root --noclear %I
  ...
  [Install]
  ...
  Alias=getty@tty1.service

Make a symlink in getty.target.wants:

  [root@host]# ln -s /etc/systemd/system/getty@tty1.service /etc/systemd/system/getty.target.wants/getty@tty1.service

Reboot the system and you will be logged in as root.

Please Note: It is highly recommend to avoid auto login of root user according to security reasons.

to_auto-login_in_centos.txt · Last modified: by steve