Merge branch 'master' of github.com:SonnyBA/dotfiles

This commit is contained in:
Sonny Bakker 2017-11-06 21:51:13 +01:00
commit 4ba2d0ce38

View file

@ -17,6 +17,8 @@ run() {
config_ssh() {
sed -i 's/^#Port .*/Port '"$PORT"'/' $CONTAINER_PATH/etc/ssh/sshd_config
sed -i 's/^#PermitRootLogin .*/PermitRootLogin yes/' $CONTAINER_PATH/etc/ssh/sshd_config
sed -i 's/^#PubkeyAuthentication .*/PubkeyAuthentication yes/' $CONTAINER_PATH/etc/ssh/sshd_config
echo $SSHKEY >> $CONTAINER_PATH/root/.ssh/authorized_keys
}
dotfiles() {
@ -44,8 +46,7 @@ PACKAGES+=$EXTRA
PACKAGES=$(echo $PACKAGES | sed 's/\ /,/g;s/,$//')
debootstrap --include=$PACKAGES $CHANNEL $CONTAINER_PATH
mkdir $CONTAINER_PATH/root/.bin/
mkdir $CONTAINER_PATH/root/.ssh
mkdir $CONTAINER_PATH/root/{.bin,.ssh}
cp $KEY $KEY.pub $CONTAINER_PATH/root/.ssh/
if [ -n "$HOSTNAME" ] ;then
@ -53,6 +54,7 @@ if [ -n "$HOSTNAME" ] ;then
fi
if [ "$SSH_SERVER" == "y" ] ;then
read -e -p "Enter ssh key for ssh access: " SSHKEY
config_ssh
fi
@ -68,8 +70,8 @@ User root
Hostname 127.0.0.1
Port $PORT
EOF
# Remove leading whitespace
sed -i 's/^ *//g' /home/$SUDO_USER/.ssh/config
# Remove leading whitespace
sed -i 's/^ *//g' /home/$SUDO_USER/.ssh/config
fi
echo "Updating default pager to less"