Ubuntu Administration Memo: Essential Commands and Configuration Notes

How to Change the SSH Port

The default SSH port is 22. For security reasons, it is recommended to change the SSH port. For example, if you change it to 1980, do as follows.

  • In /etc/ssh/sshd_config, change the following code...
#Port 22
  • Change it to the following.
Port 1980
  • If the firewall is enabled, open port 1980.
ufw allow 1980/tcp
  • Restart the SSH service.
systemctl restart ssh

Set it so that the root account can access SSH

Modify the configuration file

  • Open the /etc/ssh/sshd_config file with a text editor.
  • In the following code...
#PermitRootLogin prohibit-password
  • Remove the comment (#) and change prohibit-password to yes.
PermitRootLogin yes

Apply the settings

  • If you apply the changed settings with the following command, you will be able to SSH into the root account.
# systemctl restart ssh

If you want to use the nmtui command

If you want to use the nmtui command, install the network-manager package.

# apt install network-manager

Ubuntu Server manages networks by default using the Netplan + systemd-networkd combination. On the other hand, NetworkManager is a network management tool mainly used in desktop environments.

More in This Category
Ubuntu LTS Lifecycle

Ubuntu LTS Lifecycle

Learn how Ubuntu LTS support progresses from five years of standard security maintenance to ten years with Ubuntu Pro ESM and up to fifteen years with the Legacy add-on. The guide also lists lifecycle dates and shows how to check a system's coverage.

Ubuntu Administration Memo: Essential Commands and Configuration Notes

Ubuntu Administration Memo: Essential Commands and Configuration Notes

A practical Ubuntu administration reference covering frequently used commands, configuration files, package management, services, networking, storage, and troubleshooting checks.

How to List Installed Packages on Ubuntu with apt and dpkg-query

How to List Installed Packages on Ubuntu with apt and dpkg-query

Learn how to list installed Deb packages on Ubuntu with apt and dpkg-query, verify package status and versions, identify file ownership, and separate manual from automatic installations. The guide also covers inventory exports and Snap packages.