If you installed the GUI version of Ubuntu, SSH is disabled by default. You need to install it and enable some features.
Possible Error Message When Installing SSH Server
It it possible that you might get a message like:
- Unable to fetch
- Failed to fetch
Just run the update, that should fix it.
- run
sudo apt-get update
lab1@lab1:~$ sudo apt-get install openssh-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
openssh-sftp-server
Suggested packages:
molly-guard monkeysphere rssh ssh-askpass
Recommended packages:
ncurses-term ssh-import-id
The following NEW packages will be installed:
openssh-server openssh-sftp-server
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 378 kB of archives.
After this operation, 1,019 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Err:1 http://security.ubuntu.com/ubuntu bionic-security/main amd64 openssh-sftp-server amd64 1:7.6p1-4ubuntu0.2
404 Not Found [IP: 91.189.91.26 80]
Err:2 http://security.ubuntu.com/ubuntu bionic-security/main amd64 openssh-server amd64 1:7.6p1-4ubuntu0.2
404 Not Found [IP: 91.189.91.26 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/o/openssh/openssh-sftp-server_7.6p1-4ubuntu0.2_amd64.deb 404 Not Found [IP: 91.189.91.26 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/o/openssh/openssh-server_7.6p1-4ubuntu0.2_amd64.deb 404 Not Found [IP: 91.189.91.26 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
How to Enable or Install SSH Server
- Go to Application and search for “terminal”
- Open the terminal window
- run
sudo apt-get update
- to make sure all repositories are up to date
* lab1@lab1:~$ sudo apt-get update Get:1 http://us.archive.ubuntu.com/ubuntu bionic InRelease [242 kB] Get:2 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB] Get:3 http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB] Get:4 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB] <cut> Get:76 http://security.ubuntu.com/ubuntu bionic-security/multiverse DEP-11 64x64 Icons [2,638 B] Fetched 46.9 MB in 8s (5,572 kB/s) Reading package lists... Done
- run
sudo apt-get install openssh-server
-
lab1@lab1:~$ sudo apt-get update Get:1 http://us.archive.ubuntu.com/ubuntu bionic InRelease [242 kB] Get:2 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB] Get:3 http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB] <cut> Get:75 http://security.ubuntu.com/ubuntu bionic-security/multiverse DEP-11 48x48 Icons [29 B] Get:76 http://security.ubuntu.com/ubuntu bionic-security/multiverse DEP-11 64x64 Icons [2,638 B] Fetched 46.9 MB in 8s (5,572 kB/s) Reading package lists... Done
-
- Now test.. Success!
$ ssh lab1@192.168.1.2
The authenticity of host '192.168.1.2 (192.168.1.2)' can't be established.
RSA key fingerprint is SHA256:Jgai4QulrHZbq76OpdaUej7Pern7/j/ksNCKKELWpcg.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.1.2' (RSA) to the list of known hosts.
lab1@192.168.1.2's password:
Welcome to Ubuntu 18.04.2 LTS (GNU/Linux 4.18.0-15-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
* Canonical Livepatch is available for installation.
- Reduce system reboots and improve kernel security. Activate at:
https://ubuntu.com/livepatch
317 packages can be updated.
137 updates are security updates.
Failed to connect to https://changelogs.ubuntu.com/meta-release-lts. Check your Internet connection or proxy settings
Your Hardware Enablement Stack (HWE) is supported until April 2023.
*** /dev/sdc1 will be checked for errors at next reboot ***
The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.
lab1@lab1:~$