1
0
mirror of https://github.com/rancher/os.git synced 2025-07-19 09:26:27 +00:00

Start sshd

Keys aren't persisted at the moment
This commit is contained in:
Darren Shepherd 2015-02-20 11:47:40 -07:00
parent 4b2e98e238
commit 5e7cf9952b

View File

@ -7,6 +7,13 @@ if [ -s $CLOUD_CONFIG_FILE ]; then
cloud-init --from-file $CLOUD_CONFIG_FILE
fi
for i in rsa dsa ecdsa ed25519; do
OUTPUT=/etc/ssh/ssh_host_${i}_key
if [ ! -e $OUTPUT ]; then
ssh-keygen -f $OUTPUT -N '' -t $i
fi
done
RANCER_HOME=/home/rancher
if [ ! -d ${RANCER_HOME} ]; then
mkdir -p ${RANCER_HOME}
@ -14,6 +21,8 @@ if [ ! -d ${RANCER_HOME} ]; then
chmod 2755 ${RANCER_HOME}
fi
chown root:rancher /var/run/docker.sock:/var/run/system-docker.sock
cat > /etc/respawn.conf << EOF
/sbin/getty 115200 tty1
/sbin/getty 115200 tty2
@ -21,6 +30,7 @@ cat > /etc/respawn.conf << EOF
/sbin/getty 115200 tty4
/sbin/getty 115200 tty5
/sbin/getty 115200 tty6
/usr/sbin/sshd -D
EOF
exec respawn -f /etc/respawn.conf