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/03/16 03:03] – [Ubuntu on SDF VPS] hc9vps_-_ubuntu [2021/04/02 19:04] – [SSH] hc9
Line 1: Line 1:
 ====== Ubuntu on SDF VPS ====== ====== Ubuntu on SDF VPS ======
  
-{{:vps_-_ubuntu:8dd99b80-ubuntu-logo14.png?nolink&400|}}+{{:vps_-_ubuntu:8dd99b80-ubuntu-logo14.png?nolink&200|}}
  
 ===== Basics ===== ===== Basics =====
Line 33: Line 33:
 Delete the file ''/etc/netplan/00-installer-config.yaml'' then create a new file ''/etc/netplan/01-netcfg.yaml'', open it in an editor and add the following, replacing the text YOUR_IP with the IP address from the previous step:: Delete the file ''/etc/netplan/00-installer-config.yaml'' then create a new file ''/etc/netplan/01-netcfg.yaml'', open it in an editor and add the following, replacing the text YOUR_IP with the IP address from the previous step::
  
-<code>+<file config  /etc/netplan/01-netcfg.yaml>
  network:  network:
    version: 2    version: 2
Line 45: Line 45:
        nameservers:        nameservers:
          addresses: [205.166.94.20]          addresses: [205.166.94.20]
-</code> +</file>
  
 Save the file, then apply the config by running: Save the file, then apply the config by running:
Line 61: Line 61:
 Add this to /etc/hosts: Add this to /etc/hosts:
  
-  YOUR_IP     YOUR_HOSTNAME.sdf.org     YOUR_HOSTNAME +<file config /etc/hosts> 
- +YOUR_IP     YOUR_HOSTNAME.sdf.org     YOUR_HOSTNAME 
 +</file>
  
 Change /etc/hostname to: Change /etc/hostname to:
  
-  YOUR_HOSTNAME+<file config /etc/hostname> 
 +YOUR_HOSTNAME 
 +</file>
  
 ===== Updates ===== ===== Updates =====
Line 84: 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> 
- +PermitRootLogin no 
-Edit ''/etc/sshd/sshd_config'' and disable root login: +</file> 
- +  Restart sshd. <code> sudo systemctl restart sshd 
-  PermitRootLogin no +</code> 
- +  Create a firewall rule to allow ssh connections. 
-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> 
-  sudo systemctl restart sshd +    If you need to be able to connect from anywhere, allow 22 from anywhere. <code> sudo ufw allow 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. +
- +
-  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 ====
  
Line 127: Line 122:
  
 ---- ----
-$Id: VPS_Ubuntu.html,v 1.6 2021/01/19 02:53:52 sully Exp $ [[http://sdf.org/?tutorials/VPS_Ubuntu|CDC 6500 Survival Guide]] - traditional link (using [[wp>Revision_Control_System|RCS]])+$Id: VPS_Ubuntu.html,v 1.6 2021/01/19 02:53:52 sully Exp $ [[http://sdf.org/?tutorials/VPS_Ubuntu|VPS_Ubuntu]] - traditional link (using [[wp>Revision_Control_System|RCS]])
  
vps_-_ubuntu.txt · Last modified: 2021/04/02 19:05 by hc9