diff --git a/SSH/Create-Remote-User.bash b/SSH/Create-Remote-User.bash index e48adf2..5be8a1c 100755 --- a/SSH/Create-Remote-User.bash +++ b/SSH/Create-Remote-User.bash @@ -3,22 +3,22 @@ set -e # Remote System -REMOTE_SSH_SERVER=Home-7980XE -REMOTE_HOST_NAME=gitlab.orion-technologies.io +REMOTE_SSH_SERVER=Kansas-Xeon +REMOTE_HOST_NAME=kansas-xeon.orion-technologies.io REMOTE_USER_TO_CREATE=Sam # Local System SSH_FILE_DIRECTORY=~/.ssh SSH_FILE_NAME=${REMOTE_USER_TO_CREATE}-id_ed25519 -SSH_FILE=${SSH_FILE_DIRECTORY}/${SSH_FILE_NAME} -SSH_HOST=Home-7980XE +SSH_FILE="${SSH_FILE_DIRECTORY}"/"${SSH_FILE_NAME}" +SSH_HOST=Kansas-Xeon -ssh-keygen -b 521 -t ed25519 -f ${SSH_FILE} -N "" +ssh-keygen -b 512 -t ed25519 -f ${SSH_FILE} -N "" chmod 600 ${SSH_FILE} PUB_KEY_CONTENTS=$(cat ${SSH_FILE}.pub) -ssh ${REMOTE_SSH_SERVER} /bin/bash << EOF +ssh root@${REMOTE_SSH_SERVER} /bin/bash << EOF useradd ${REMOTE_USER_TO_CREATE} mkdir /home/${REMOTE_USER_TO_CREATE}/.ssh touch /home/${REMOTE_USER_TO_CREATE}/.ssh/authorized_keys @@ -30,9 +30,8 @@ cat << EOF >> ~/.ssh/config Host ${SSH_HOST} HostName ${REMOTE_HOST_NAME} - Match user ${REMOTE_USER_TO_CREATE} + Match user ${REMOTE_USER_TO_CREATE} host ${REMOTE_HOST_NAME} Identityfile ${SSH_FILE} - LogLevel INFO EOF ssh ${REMOTE_USER_TO_CREATE}@${SSH_HOST} /bin/bash << EOF