I tried to ssh to localhost on my UBUNTU PC but the connection was refused:
UBUNTU > ssh localhost
ssh: connect to host localhost port 22: Connection refused
UBUNTU >
This was because ssh had not been set up on my machine. I set it up like this:
UBUNTU > sudo apt-get install openssh-server openssh-client
Reading package lists... Done
Building dependency tree
Reading state information... Done
openssh-client is already the newest version.
Suggested packages:
rssh molly-guard openssh-blacklist openssh-blacklist-extra monkeysphere
The following NEW packages will be installed
openssh-server ssh-import-id
0 upgraded, 2 newly installed, 0 to remove and 576 not upgraded.
Need to get 348 kB of archives.
After this operation, 891 kB of additional disk space will be used.
Get:1 http://gb.archive.ubuntu.com/ubuntu/ precise/main openssh-server i386 1:5.9p1-5ubuntu1 [342 kB]
Get:2 http://gb.archive.ubuntu.com/ubuntu/ precise/main ssh-import-id all 2.10-0ubuntu1 [6.598 B]
Fetched 348 kB in 1s (288 kB/s)
Preconfiguring packages ...
Selecting previously unselected package openssh-server.
(Reading database ... 153823 files and directories currently installed.)
Unpacking openssh-server (from .../openssh-server_1%3a5.9p1-5ubuntu1_i386.deb) ...
Selecting previously unselected package ssh-import-id.
Unpacking ssh-import-id (from .../ssh-import-id_2.10-0ubuntu1_all.deb) ...
Processing triggers for ureadahead ...
ureadahead will be reprofiled on next reboot
me time ...
CreaProcessing triggers for ufw ...
Processing triggers for man-db ...
Setting up openssh-server (1:5.9p1-5ubuntu1) ...
Creating SSH2 RSA key; this may take some time ...
Creating SSH2 DSA key; this may take soting SSH2 ECDSA key; this may take some time ...
ssh start/running, process 3144
Setting up ssh-import-id (2.10-0ubuntu1) ...
UBUNTU >
Then I was able to connect as follows:
UBUNTU > ssh localhost
The authenticity of host 'localhost (127.0.0.1)' can't be established.
ECDSA key fingerprint is 56:30:a1:d5:23:9b:3f:a4:3b:30:6c:2c:07:c5:8e:3e.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'localhost' (ECDSA) to the list of known hosts.
andrew@localhost's password:
Welcome to Ubuntu 12.04 LTS (GNU/Linux 3.2.0-23-generic-pae i686)
* Documentation: https://help.ubuntu.com/
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.
No mail.
UBUNTU >