mirror of
https://github.com/rancher/os.git
synced 2025-09-17 07:30:42 +00:00
Merge branch 'cloudinit' of github.com:sidharthamani/os into sidharthamani-cloudinit
Conflicts: scripts/dockerimages/06-console
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
FROM base
|
||||
COPY scripts/dockerimages/scripts/console.sh /usr/sbin/
|
||||
COPY scripts/dockerimages/scripts/update-ssh-keys /usr/bin/
|
||||
RUN sed -i 's/rancher.*/rancher:rixbL64o6zGmY:16486:0:99999:7:::/g' /etc/shadow && \
|
||||
echo '## allow password less for rancher user' >> /etc/sudoers && \
|
||||
echo 'rancher ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
|
||||
|
@@ -2,6 +2,4 @@
|
||||
|
||||
set -x -e
|
||||
|
||||
CLOUD_CONFIG_FLAGS=$(rancherctl config get cloud_config)
|
||||
|
||||
cloud-init --preinit "$CLOUD_CONFIG_FLAGS"
|
||||
cloud-init
|
||||
|
13
scripts/dockerimages/scripts/update-ssh-keys
Executable file
13
scripts/dockerimages/scripts/update-ssh-keys
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
USERNAME=$1
|
||||
HOME_DIR=$(grep ^$USERNAME /etc/passwd | cut -f6 -d:)
|
||||
|
||||
if [ ! -d $HOME_DIR/.ssh ]; then
|
||||
mkdir -p $HOME_DIR/.ssh
|
||||
fi
|
||||
|
||||
|
||||
if [ ! grep -q $HOME_DIR/.ssh/authorized_keys ]; then
|
||||
echo "$2" >> $HOME_DIR/.ssh/authorized_keys
|
||||
fi
|
Reference in New Issue
Block a user