Thursday, November 12, 2009

Enabling SSH on Ubuntu

Ok, not sure why I want to blog this, but guess I ran into it today trying to P2V a Linux machine running Ubuntu. You need ssh enabled for Linux - since I normally do Windows, I had to quickly figure it out -- Here is basically my Terminal session and testing to see if worked:

1. First get the openssh-server software:

machine_name@ubuntu:~$ sudo apt-get install openssh-server
[sudo] password for machine-name:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
rssh molly-guard openssh-blacklist openssh-blacklist-extra
The following NEW packages will be installed:
openssh-server
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 286kB of archives.
After this operation, 766kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com karmic/main openssh-server 1:5.1p1-6ubuntu2 [286kB]
Fetched 286kB in 2s (104kB/s)
Preconfiguring packages ...
Selecting previously deselected package openssh-server.
(Reading database ... 132547 files and directories currently installed.)
Unpacking openssh-server (from .../openssh-server_1%3a5.1p1-6ubuntu2_i386.deb) ...
Processing triggers for sreadahead ...
sreadahead will be reprofiled on next reboot
Processing triggers for ufw ...
Processing triggers for man-db ...
Setting up openssh-server (1:5.1p1-6ubuntu2) ...
Creating SSH2 RSA key; this may take some time ...
Creating SSH2 DSA key; this may take some time ...
* Restarting OpenBSD Secure Shell server sshd [ OK ]

2. Next Test to see if it is running:

machine_name@ubuntu:~$ ps -aef | grep sshd

root 3663 1 0 15:38 ? 00:00:00 /usr/sbin/sshd
user_me 3679 3488 0 15:39 pts/0 00:00:00 grep sshd

3. Next ssh to it right there from your own machine:

machine_name@ubuntu:~$ ssh localhost
The authenticity of host 'localhost (127.0.0.1)' can't be established.
RSA key fingerprint is f0:7f:e7:82:6c:61:d0:61:85:66:31:10:1f:72:b1:7e.

4. Type yes
Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added 'localhost' (RSA) to the list of known hosts.
machine_name@localhost's password:
Linux ubuntu 2.6.31-14-generic #48-Ubuntu SMP Fri Oct 16 14:04:26 UTC 2009 i686

To access official Ubuntu documentation, please visit:
http://help.ubuntu.com/

0 packages can be updated.
0 updates are security updates.


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.

5. At this time your on and working, typing exit, brings you back to the terminal. You can test remotely with putty.

Delco

No comments: