Skip to content

Instantly share code, notes, and snippets.

@vqoph
Last active May 9, 2016 11:35
Show Gist options
  • Save vqoph/b4f4c4f635be763ea5e7aa85640d5edf to your computer and use it in GitHub Desktop.
Save vqoph/b4f4c4f635be763ea5e7aa85640d5edf to your computer and use it in GitHub Desktop.
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
@vqoph
Copy link
Author

vqoph commented May 9, 2016

quick use :
bash <(wget -O- -nv --quiet https://gist.githubusercontent.com/vqoph/b4f4c4f635be763ea5e7aa85640d5edf/raw/install-vps.sh)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment