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
vps_-_ubuntu [2021/03/16 02:55] hc9vps_-_ubuntu [2021/04/02 19:05] (current) – [Cleanup] hc9
Line 1: Line 1:
 ====== Ubuntu on SDF VPS ====== ====== Ubuntu on SDF VPS ======
  
-IMAGE_HERE +{{:vps_-_ubuntu:8dd99b80-ubuntu-logo14.png?nolink&200|}}
-8dd99b80-ubuntu-logo14.png+
  
 ===== Basics ===== ===== Basics =====
Line 34: 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 46: 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 62: 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 85: 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 ====
  
 There are a few things that can be removed at this point to clean up your install to reduce resource use and protect your privacy. There are a few things that can be removed at this point to clean up your install to reduce resource use and protect your privacy.
  
-When you type a command that's not found on your $PATH, Ubuntu will try to look it up and recommend packages to install that may be what you're looking for. This often means that instead of a quick error message, there is a delay before returning to a prompt. You can stop this behavior by removing the command-not-found package.+When you type a command that's not found on your $PATH, Ubuntu will try to look it up and recommend packages to install that may be what you're looking for. This often means that instead of a quick error message, there is a delay before returning to a prompt. You can stop this behavior by removing the ''command-not-found'' package.
  
   sudo apt-get purge command-not-found   sudo apt-get purge command-not-found
Line 121: Line 115:
   sudo apt autoremove   sudo apt autoremove
  
-You may have noticed that on login, your MOTD contains a lot of information, some of which is dynamically generated from sources on the internet. One of these steps sends information about the machine to Ubuntu as part of the request for latest news. We can disable this in /etc/default/motd-news.+You may have noticed that on login, your MOTD contains a lot of information, some of which is dynamically generated from sources on the internet. One of these steps sends information about the machine to Ubuntu as part of the request for latest news. We can disable this in ''/etc/default/motd-news''.
  
-  ENABLED=0+<file config /etc/default/motd-news> 
 +ENABLED=0 
 +</file>
  
-You can take this further and move or delete the files found in /etc/update-motd.d/ and optionally replace them with your own script. On login, Ubuntu will execute the scripts in this folder and display anything they send to stdout. You can also create /etc/motd and any text in that file will be displayed after any output from your motd scripts.+You can take this further and move or delete the files found in ''/etc/update-motd.d/'' and optionally replace them with your own script. On login, Ubuntu will execute the scripts in this folder and display anything they send to stdout. You can also create ''/etc/motd'' and any text in that file will be displayed after any output from your motd scripts.
  
 ---- ----
-$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.1615863327.txt.gz · Last modified: 2021/03/16 02:55 by hc9