<\/span><\/h2>\n\n\n\nBefore enabling SSH, it’s always a good practice to ensure your system is up-to-date. Open a terminal on your Ubuntu system and run the following commands:<\/p>\n\n\n\n
# apt update\n# apt upgrade<\/code><\/pre>\n\n\n\n<\/span>Step 2: Install SSH Server<\/span><\/h2>\n\n\n\nSSH server should be installed on your Ubuntu system by default. However, if for some reason it’s not installed, you can install it using the following command:<\/p>\n\n\n\n
# apt install openssh-server<\/code><\/pre>\n\n\n\nAfter installing the SSH server, you can check its status to ensure it’s running. You can run the following command:<\/p>\n\n\n\n
# systemctl status ssh<\/code><\/pre>\n\n\n\nYou should receive a similar output:<\/p>\n\n\n\n
ssh.service - OpenBSD Secure Shell server\n Loaded: loaded (\/lib\/systemd\/system\/ssh.service; enabled; vendor preset: e>\n Active: active (running) since Fri 2024-01-12 23:40:03 UTC; 1 month 7 days>\n Docs: man:sshd(8)\n man:sshd_config(5)\n Process: 665 ExecStartPre=\/usr\/sbin\/sshd -t (code=exited, status=0\/SUCCESS)\n Main PID: 732 (sshd)<\/code><\/pre>\n\n\n\nIf it’s not running, you can start it using: sudo systemctl start ssh<\/p>\n\n\n\n