Created 05-09-2018 02:45 PM
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?
Created 05-09-2018 03:00 PM
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>"
Created on 05-10-2018 06:40 AM - edited 08-18-2019 01:14 AM
@Harald Berghoff yes, i want to auto-login when I restart my sandbox in virtual machine. When this display appear.
Created 05-12-2018 07:10 AM
for centos7 just check if you have he following file (should be a symlink) available
/etc/systemd/system/getty.target.wants/getty@tty1.service
If it exists you can enable the autologin like this:
# rm /etc/systemd/system/getty.target.wants/getty@tty1.service # cp /lib/systemd/system/getty@.service /etc/systemd/system/getty@tty1.service # ln -s /etc/systemd/system/getty@tty1.service /etc/systemd/system/getty.target.wants/getty@tty1.service<code>
Now edit the file /etc/systemd/system/getty@tty1.service so that these lines exist (last line must be added)
[Service]
...
ExecStart=-/sbin/agetty --autologin root --noclear %I
...
[Install]
...
;Alias=getty@tty1.service
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.