Thursday, February 12, 2009

How to use SSH in Ubuntu

Let's set it up first...
1. Type sudo aptitude install ssh to install ssh service
2. select "yes" for install to proceed

Now how to connect to your Ubuntu ssh enabled machine...
1. type ssh username@ipaddr or username@domainname
2. If it's the first time to connect to your computer a verification will prompt you to validate it.
3. if you choose "yes" and the password you entered is correct the login on your ubuntu pc should show.

To check the logged on Users in your Ubuntu PC...
1. just type who -u to see the connected users in you machine
1a. sample output:
rorfano tty7 2009-02-05 09:52 . 6539 (:0)
rorfano pts/0 2009-02-06 17:18 . 26248 (:0.0)

this means that there are no users connected to my machine.

2a. sample output:
rorfano tty7 2009-02-05 09:52 . 6539 (:0)
rorfano pts/0 2009-02-06 17:18 . 26248 (:0.0)
rorfano pts/1 2009-02-12 10:34 . 6508 (tenchi.local)

this means that the machine "tenchi.local" is connected to my machine.

To check the log...
1. Just type tail /var/log/auth.log | grep "Accepted password"
1a. sample output:
Feb 12 10:17:48 Ichigo-pc sshd[6223]: Accepted password for rorfano from 192.168.10.100 port 5061 ssh2

2. as the ssh is used more often the log file will pile up with these lines.
3. as a security measure often check this log to see if there's an intruder logged-on in your machine.

have fun!

No comments: