blob: 30266261ab6ca101688bef937c7327c44cc4a077 [file] [log] [blame]
Filip Pytloun896f37b2015-06-25 18:35:42 +02001# Auto login root on tty1
2sed -i 's|/sbin/getty|/sbin/getty --autologin root|g' /etc/init/tty1.conf
3
Filip Pytlounac2be792016-01-08 12:09:49 +01004# Libvirt serial console support
5cat << '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
11start on stopped rc RUNLEVEL=[2345] and (
12 not-container or
13 container CONTAINER=lxc or
14 container CONTAINER=lxc-libvirt)
15
16stop on runlevel [!2345]
17
18respawn
19exec /sbin/getty --autologin root -8 115200 ttyS0 xterm
20EOF
21
Filip Pytloun896f37b2015-06-25 18:35:42 +020022# Disable password root login
23usermod -p '!' root
24
25# Disable SSH password authentication and permit root login
26sed -i 's|[#]*PasswordAuthentication yes|PasswordAuthentication no|g' /etc/ssh/sshd_config
27sed -i 's|[#]*PermitRootLogin no|PermitRootLogin yes|g' /etc/ssh/sshd_config