i think we've got it...
This commit is contained in:
22
newSrv.sh
22
newSrv.sh
@ -1,5 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
|
||||||
# Standard strict mode and error handling boilderplate...
|
# Standard strict mode and error handling boilderplate...
|
||||||
|
|
||||||
@ -88,19 +87,30 @@ curl --silent http://dl.knownelement.com/FetchApplyDistPoint/rsyslog.conf> /etc/
|
|||||||
|
|
||||||
export ROOT_SSH_DIR="/root/.ssh"
|
export ROOT_SSH_DIR="/root/.ssh"
|
||||||
export LOCALUSER_SSH_DIR="/home/localuser/.ssh"
|
export LOCALUSER_SSH_DIR="/home/localuser/.ssh"
|
||||||
|
export SUBODEV_SSH_DIR="/home/subodev/.ssh"
|
||||||
|
|
||||||
if [ ! -d $ROOT_SSH_DIR ]; then
|
if [ ! -d $ROOT_SSH_DIR ]; then
|
||||||
mkdir /root/.ssh/
|
mkdir /root/.ssh/
|
||||||
|
curl --silent http://dl.knownelement.com/FetchApplyDistPoint/ssh-authorized-keys> /root/.ssh/authorized_keys && chmod 400 /root/.ssh/authorized_keys
|
||||||
|
chmod 400 /root/.ssh/authorized_keys
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -d $LOCALUSER_SSH_DIR ]; then
|
if [ ! -d $LOCALUSER_SSH_DIR ]; then
|
||||||
|
if [ ! -d /home/subodev ]; then
|
||||||
mkdir /home/localuser/.ssh/
|
mkdir /home/localuser/.ssh/
|
||||||
|
curl --silent http://dl.knownelement.com/FetchApplyDistPoint/ssh-authorized-keys> /home/localuser/.ssh/authorized_keys && chmod 400 /home/localuser/.ssh/authorized_keys
|
||||||
|
chmod 400 /home/localuser/.ssh/authorized_keys
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -d $SUBODEV_SSH_DIR ]; then
|
||||||
|
if [ ! -d /home/localuser]; then
|
||||||
|
mkdir /home/subodev/.ssh/
|
||||||
|
curl --silent http://dl.knownelement.com/FetchApplyDistPoint/ssh-authorized-keys> /home/subodev/.ssh/authorized_keys && chmod 400 /home/subodev/.ssh/authorized_keys
|
||||||
|
chmod 400 /home/subodev/.ssh/authorized_keys
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
curl --silent http://dl.knownelement.com/FetchApplyDistPoint/ssh-authorized-keys> /root/.ssh/authorized_keys && chmod 400 /root/.ssh/authorized_keys
|
|
||||||
chmod 400 /root/.ssh/authorized_keys
|
|
||||||
curl --silent http://dl.knownelement.com/FetchApplyDistPoint/ssh-authorized-keys> /home/localuser/.ssh/authorized_keys && chmod 400 /home/localuser/.ssh/authorized_keys
|
|
||||||
chmod 400 /home/localuser/.ssh/authorized_keys
|
|
||||||
|
|
||||||
echo "Completed running $FUNCNAME"
|
echo "Completed running $FUNCNAME"
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user