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 03:05] – [Cleanup] hc9vps_-_ubuntu [2021/04/02 19:05] (current) – [Cleanup] 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 122: Line 117:
 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.
vps_-_ubuntu.1615863932.txt.gz · Last modified: 2021/03/16 03:05 by hc9