Monday, May 6, 2024
 Popular · Latest · Hot · Upcoming
8
rated 0 times [  8] [ 0]  / answers: 1 / hits: 11239  / 3 Years ago, sun, may 23, 2021, 1:27:53

I have a virtual guest of Ubuntu on a KVM Machine, I've setup the machine so I can type virsh console and be dropped into a console.



I realise the security considerations here, but is it possible to set the guest up so that if a user connects via console they are automatically root without having to type in any password. However this is only for serial console and not for SSH or remote access.



This isn't really a KVM question but just a system setup, the console has been setup as a device on /dev/ttyS0.


More From » server

 Answers
4

edit /etc/init/tty1.conf:



sudo nano -w /etc/init/tty1.conf


replace the content with the following:



# tty1 - getty
#
# This service maintains a getty on tty1 from the point the system is
# started until it is shut down again.

start on stopped rc RUNLEVEL=[2345] and (
not-container or
container CONTAINER=lxc or
container CONTAINER=lxc-libvirt)

stop on runlevel [!2345]

respawn
exec /sbin/getty --autologin root -8 38400 tty1


the important change is the last line includes --autologin root as an argument.



Once the change is made it can be activated with a reboot or by running sudo stop tty1 && sudo start tty1


[#32181] Sunday, May 23, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ngthmated

Total Points: 12
Total Questions: 115
Total Answers: 113

Location: Saint Vincent and the Grenadines
Member since Wed, Apr 21, 2021
3 Years ago
;