be extra safe with ssh logins

This commit is contained in:
Yannik Schmidt
2021-08-31 01:16:43 +02:00
parent 39b7032983
commit 15bfb4335b
2 changed files with 4 additions and 3 deletions

View File

@@ -1,5 +1,3 @@
#!/bin/bash
useradd -m -p ${1} ${2}
usermod -L ${2}
chsh -s "/sbin/nologin" ${2}

View File

@@ -14,7 +14,7 @@ ssh -t ${TARGET} "${CMD_FLASK_USER}"
ssh -t ${TARGET} "${CMD_SUDOERS_ADD}"
ssh -t ${TARGET} "${CMD_SUDOERS_DEL}"
rsync -rP ../jeffrey_miller_flask_ftp ${TARGET}:/home/flask/
rsync -r ../jeffrey_miller_flask_ftp ${TARGET}:/home/flask/
CMD_OWNERSHIP="chown -R flask:flask /home/flask"
@@ -24,3 +24,6 @@ CMD_SET_FTP_WRITE_YES="sed -i 's/\#write_enable=YES/write_enable=YES/' /etc/vsft
CMD_RESTART_FTP="systemctl restart vsftpd"
ssh -t ${TARGET} "${CMD_SET_FTP_WRITE_YES}"
ssh -t ${TARGET} "${CMD_RESTART_FTP}"
CMD_LOCK_SSH="echo 'AllowUsers root' >> /etc/ssh/sshd_config"
ssh -t ${TARGET} "${CMD_LOCK_SSH}"