Filip Pytloun | 896f37b | 2015-06-25 18:35:42 +0200 | [diff] [blame] | 1 | # Auto login root on tty1 |
| 2 | sed -i 's|/sbin/getty|/sbin/getty --autologin root|g' /etc/init/tty1.conf |
| 3 | |
Filip Pytloun | ac2be79 | 2016-01-08 12:09:49 +0100 | [diff] [blame] | 4 | # Libvirt serial console support |
| 5 | cat << 'EOF' >> /etc/init/ttyS0.conf |
| 6 | # ttyS0 - getty |
| 7 | # |
| 8 | # This service maintains a getty on tty1 from the point the system is |
| 9 | # started until it is shut down again. |
| 10 | |
| 11 | start on stopped rc RUNLEVEL=[2345] and ( |
| 12 | not-container or |
| 13 | container CONTAINER=lxc or |
| 14 | container CONTAINER=lxc-libvirt) |
| 15 | |
| 16 | stop on runlevel [!2345] |
| 17 | |
| 18 | respawn |
| 19 | exec /sbin/getty --autologin root -8 115200 ttyS0 xterm |
| 20 | EOF |
| 21 | |
Filip Pytloun | 896f37b | 2015-06-25 18:35:42 +0200 | [diff] [blame] | 22 | # Disable password root login |
| 23 | usermod -p '!' root |
| 24 | |
| 25 | # Disable SSH password authentication and permit root login |
| 26 | sed -i 's|[#]*PasswordAuthentication yes|PasswordAuthentication no|g' /etc/ssh/sshd_config |
| 27 | sed -i 's|[#]*PermitRootLogin no|PermitRootLogin yes|g' /etc/ssh/sshd_config |