Last active
May 9, 2016 11:35
-
-
Save vqoph/b4f4c4f635be763ea5e7aa85640d5edf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
read -p "Username of the VPS: " username | |
useradd -ms /bin/bash $username | |
passwd $username | |
groupadd ssh-users | |
adduser $username ssh-users | |
adduser $username sudo | |
read -p "Define a ssh port: " port | |
echo "Change ssh port to $port use ssh user@host -p $port" | |
sed -i "s/\(Port *\).*/Port $port/" /etc/ssh/sshd_config | |
sed -i "s/\(PermitRootLogin *\).*/PermitRootLogin no/" /etc/ssh/sshd_config | |
echo "AllowGroups ssh-users" >> /etc/ssh/sshd_config | |
echo "Restart ssh" | |
service ssh restart | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
quick use :
bash <(wget -O- -nv --quiet https://gist.githubusercontent.com/vqoph/b4f4c4f635be763ea5e7aa85640d5edf/raw/install-vps.sh)