Dzmitry Stremkouski | 1ca901c | 2018-11-05 13:20:52 +0100 | [diff] [blame] | 1 | #!/bin/bash -xe |
| 2 | # Speedup reverse hostname lookup |
| 3 | sed -i "s/127.0.0.1.*/127.0.0.1 localhost $(hostname)/" /etc/hosts |
| 4 | # Enabling password auth for kitchen user |
| 5 | sed -i 's/PasswordAuthentication.*/PasswordAuthentication yes/' /etc/ssh/sshd_config |
| 6 | # Disable sshd NS lookups |
| 7 | echo "UseDNS no" >> /etc/ssh/sshd_config |
Dzmitry Stremkouski | a5871a6 | 2018-11-07 23:04:36 +0100 | [diff] [blame] | 8 | # Apply ssh configuration |
Dzmitry Stremkouski | 1ca901c | 2018-11-05 13:20:52 +0100 | [diff] [blame] | 9 | service ssh restart |
Dzmitry Stremkouski | a5871a6 | 2018-11-07 23:04:36 +0100 | [diff] [blame] | 10 | |
Dzmitry Stremkouski | 1ca901c | 2018-11-05 13:20:52 +0100 | [diff] [blame] | 11 | # Create user 'kitchen' with password 'kitchen' |
| 12 | useradd -m -G adm,sudo -p '$6$DqOdqb/l$hOpDWFPeC8/45Oo8NbqZyqLZxYd.Vtlujf9A4OdwUKgBjRcETuc9Gd2C7OyI99MY2N/pACrbV8WymqV.H1XZ1.' -s /bin/bash kitchen |
| 13 | # Passwordless sudo for user 'kitchen' |
| 14 | echo "kitchen ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/99-kitchen |
| 15 | # Secure kitchen home |
| 16 | chown kitchen:root /home/kitchen -R |
| 17 | chmod 0700 /home/kitchen |