Posted by: isaraffee | August 29, 2009

Exploring SSH in Dreamlinux 2.2

Exploring SSH in Dreamlinux 2.2

In this exercise, you will need a ssh server and a ssh client. I have assigned Ubuntu as my ssh server while Dreamlinux takes the role of a ssh client.

On the SSH server

root@ismailrocks:~# ps -ef | grep ssh

root 4598 1 0 09:27 ? 00:00:00 /usr/sbin/sshd

root 5099 5061 0 09:27 ? 00:00:00 /usr/bin/ssh-agent x-session-manager

The above results shows that the sshd service which is the ssh server service is running.

root@mars:~# ssh 172.18.0.2

root@172.18.0.2’s password:

Last login: Fri Jul 31 10:28:03 2009 from 172.16.0.2

Linux ismailrocks 2.6.22-16-generic #1 SMP Mon Jan 26 00:07:52 GMT 2009 i686

To run a command as administrator (user “root”), use “sudo <command>”.

See “man sudo_root” for details.

root@ismailrocks:~#

Secure Copy is ssh

I will secure copy a document from the Ubuntu server to the Dreamlinux server.

root@mars:~# scp root@172.18.0.2:/root/Documents/ubuntu_wireless.doc .

root@172.18.0.2’s password:

ubuntu_wireless.doc 100% 116KB 6.4KB/s 00:18

Now let’s change roles. The Dreamlinux will be the ssh server, while the Ubuntu server takes on the role of a ssh client.

You will need to start the sshd service on the Dreamlinux, if it is not started.

root@mars:~# /usr/sbin/sshd

Type the following to check sshd is running.

root@mars:~# ps -ef|grep sshd

root 4151 1 0 15:51 ? 00:00:00 /usr/sbin/sshd

Now from the ssh client, in my case the Ubuntu server, ssh into the Dreamlinux server.

root@ismailrocks:~# ssh 172.16.0.2

root@172.16.0.2’s password:

Last login: Tue Aug 11 15:31:48 2009

Linux mars 2.6.18.1-kanotix-1 #1 SMP PREEMPT Wed Nov 29 15:15:15 EST 2006 i686

So we successfully ssh into the Dreamlinux server.

X11 Forwarding

You can launch X applications like gedit, xmms, cdp xeyes, xclock on your remote host but the applications will appear on your local machine.

On local host, Dreamlinux, check that X11 forwarding is enable.

root@mars:/etc/ssh# grep -i forward ssh_config

# ForwardAgent no

ForwardX11 yes

ForwardX11Trusted yes

If yours is not enable, edit the file and make the necessary changes

On remote host, Ubuntu, you will also need to enable X11 forwaring.

Now we are set to experiment on X11 forwaring.

On local host, Dreamlinux, type:

root@mars:/etc/ssh# ssh -X 172.18.0.2

Simply replace the IP address with your owmn machine.

root@mars:/mnt/auto# ssh -X 172.18.0.2

root@172.18.0.2’s password:

Last login: Tue Aug 11 16:45:51 2009 from 172.16.0.2

Linux ismailrocks 2.6.22-16-generic #1 SMP Mon Jan 26 00:07:52 GMT 2009 i686

Now type:

root@ismailrocks:~# xterm &

You will see an xterm window appears on your screen.

insert screenshot

You can control the DVD tray, play mp3 and video files and many more.

Note: If you want the applications to appear on the remote site instead on your local machine, you have to export the DISPLAY variable.

On the remote site, type:

export DISPLAY=:0.0

Now at the local site, in the xterm which already has a ssh connection to the remote site, type xeyes. You will see that xeyes will appear on the remote site.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: