Support Questions

Find answers, ask questions, and share your expertise

How to auto login as root user into Hortonworks Sandbox


I have install 2.5 Sandbox into Oracle virtual machine. I have configured once as auto login as `root` user in Sandbox but i was facing some problem with Sandbox. Thus, I uninstalled. Now I want to pre-login as `root` user for sandbox. Could anyone help me?


Super Collaborator

Do you mean via console or via ssh? If via ssh it will be dependent on your ssh client. For the console you can check either for the grub boot parameter and configure it to start only into text mode (GRUB_CMDLINE_LINUX_DEFAULT="text") and in the config for the tty you can add the parameter -a <username>. This config should be at /etc/init/tty1.conf

Or you configure /etc/inittab and add there the parameter "login -f <username>"


@Harald Berghoff yes, i want to auto-login when I restart my sandbox in virtual machine. When this display appear.


Super Collaborator

for centos7 just check if you have he following file (should be a symlink) available

If it exists you can enable the autologin like this:

# rm /etc/systemd/system/
# cp /lib/systemd/system/getty@.service /etc/systemd/system/getty@tty1.service
# ln -s /etc/systemd/system/getty@tty1.service /etc/systemd/system/<code>

Now edit the file /etc/systemd/system/getty@tty1.service so that these lines exist (last line must be added)

ExecStart=-/sbin/agetty --autologin root --noclear %I

With the next reboot it should automatically login root on tty1, which should be the default console.

Of course it is an unsafe configuration, everyone with access to the console has root privilegs, but I guess you are aware of that.