Last active
July 22, 2023 17:21
-
-
Save whonion/d013f5ad2d53084a69fa73d4d17b51d0 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
ssh-keygen -t rsa | |
#set passphrase on your private_key | |
cp .ssh/id_rsa.pub .ssh/authorized_keys | |
rm -rf .ssh/id_rsa | |
nano /etc/ssh/sshd_config | |
Port 65500 #set_custom_port | |
PasswordAuthentication no | |
PermitEmptyPasswords no | |
PermitRootLogin no | |
#add allow user@ip for connect to your server | |
AllowUsers user@allow_ip_1 user@allow_ip_2 user@allow_ip_3 user@allow_ip_4 | |
chmod 700 ~/.ssh | |
chmod 600 ~/.ssh/authorized_keys | |
sudo service ssh restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment