User Tools

Site Tools


vps_-_ubuntu

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
vps_-_ubuntu [2021/04/02 18:58] – [SSH] hc9vps_-_ubuntu [2021/04/02 19:04] – [SSH] hc9
Line 87: Line 87:
 ===== SSH ===== ===== SSH =====
  
-Install SSH. +  * Install SSH. <code> sudo apt-get install openssh-server 
- +</code> 
-  sudo apt-get install openssh-server +  Edit ''/etc/sshd/sshd_config'' and disable root login: <file config /etc/sshd/sshd_config>
- +
-Edit ''/etc/sshd/sshd_config'' and disable root login: +
- +
-<file config /etc/sshd/sshd_config>+
 PermitRootLogin no PermitRootLogin no
 </file> </file>
- +  * Restart sshd. <code> sudo systemctl restart sshd 
-Restart sshd. +</code> 
- +  Create a firewall rule to allow ssh connections. 
-  sudo systemctl restart sshd +    * If you'll always be connecting from the same ip (eg. your home computer) you can create explicit rules to only allow that ip to connect. However, note that most ISPs do not assign static IPs, so if yours changes you'll need to log into the console and update your firewall. <code> sudo ufw allow from YOUR_HOME_IP/32 to any port 22 
- +</code> 
-Create a firewall rule to allow ssh connections. If you'll always be connecting from the same ip (eg. your home computer) you can create explicit rules to only allow that ip to connect. However, note that most ISPs do not assign static IPs, so if yours changes you'll need to log into the console and update your firewall. +    If you need to be able to connect from anywhere, allow 22 from anywhere. <code> sudo ufw allow 22 
- +</code>
-  sudo ufw allow from YOUR_HOME_IP/32 to any port 22 +
- +
-If you need to be able to connect from anywhere, allow 22 from anywhere. +
- +
-  sudo ufw allow 22 +
 ==== Cleanup ==== ==== Cleanup ====
  
vps_-_ubuntu.txt · Last modified: 2021/04/02 19:05 by hc9