mirror of
https://github.com/rancher/os.git
synced 2025-07-20 09:59:03 +00:00
Start sshd
Keys aren't persisted at the moment
This commit is contained in:
parent
4b2e98e238
commit
5e7cf9952b
@ -7,6 +7,13 @@ if [ -s $CLOUD_CONFIG_FILE ]; then
|
|||||||
cloud-init --from-file $CLOUD_CONFIG_FILE
|
cloud-init --from-file $CLOUD_CONFIG_FILE
|
||||||
fi
|
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
|
RANCER_HOME=/home/rancher
|
||||||
if [ ! -d ${RANCER_HOME} ]; then
|
if [ ! -d ${RANCER_HOME} ]; then
|
||||||
mkdir -p ${RANCER_HOME}
|
mkdir -p ${RANCER_HOME}
|
||||||
@ -14,6 +21,8 @@ if [ ! -d ${RANCER_HOME} ]; then
|
|||||||
chmod 2755 ${RANCER_HOME}
|
chmod 2755 ${RANCER_HOME}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
chown root:rancher /var/run/docker.sock:/var/run/system-docker.sock
|
||||||
|
|
||||||
cat > /etc/respawn.conf << EOF
|
cat > /etc/respawn.conf << EOF
|
||||||
/sbin/getty 115200 tty1
|
/sbin/getty 115200 tty1
|
||||||
/sbin/getty 115200 tty2
|
/sbin/getty 115200 tty2
|
||||||
@ -21,6 +30,7 @@ cat > /etc/respawn.conf << EOF
|
|||||||
/sbin/getty 115200 tty4
|
/sbin/getty 115200 tty4
|
||||||
/sbin/getty 115200 tty5
|
/sbin/getty 115200 tty5
|
||||||
/sbin/getty 115200 tty6
|
/sbin/getty 115200 tty6
|
||||||
|
/usr/sbin/sshd -D
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
exec respawn -f /etc/respawn.conf
|
exec respawn -f /etc/respawn.conf
|
||||||
|
Loading…
Reference in New Issue
Block a user