File: ubuntu_setup.sh

package info (click to toggle)
ruby-sshkit 1.25.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 712 kB
  • sloc: ruby: 3,749; makefile: 2
file content (22 lines) | stat: -rwxr-xr-x 531 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash

set -e

export DEBIAN_FRONTEND=noninteractive
apt -y update

# Create `deployer` user that can sudo without a password
apt-get -y install sudo
adduser --disabled-password deployer < /dev/null
echo "deployer:topsecret" | chpasswd
echo "deployer ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers

# Install and configure sshd
apt-get -y install openssh-server
{
  echo "Port 22"
  echo "PasswordAuthentication yes"
  echo "ChallengeResponseAuthentication no"
} >> /etc/ssh/sshd_config
mkdir /var/run/sshd
chmod 0755 /var/run/sshd