Posted by: isaraffee | August 10, 2009

Exploring ssh in Sabayon Linux

SSH in Sabayon

Like in other distributions, to use secure shell i.e ssh, the ssd daemons sshd must be running:

sabayonx86 ~ # ps -ef|grep ssh

root 19161 12873 0 11:47 pts/1 00:00:00 grep ssh

From the output shown above, ssh server or client is not running

If ssh not running, you cannot run any ssh commands:

sabayonx86 dev # ssh sabayonx86

ssh: connect to host sabayonx86 port 22: Connection refused

To check if ssh is installed, type:

sabayonx86 dev # emerge –search ssh


[ Results for search key : ssh ]

[ Applications found : 26 ]

* net-misc/openssh

Latest version available: 5.2_p1-r1

Latest version installed: 4.4_p1-r4

Size of files: 1,244 kB


Description: Port of OpenBSD’s free SSH release

License: as-is

<output truncated for brevity>

The output shows that the openssh package is installed.

To locate sshd, type:

sabayonx86 ~ # which sshd


To locate other files which are assocated with ssh, type:

sabayonx86 ~ # equery files net-misc/openssh

!!! SELinux module not found. Please verify that it was installed.

[ Searching for packages matching net-misc/openssh… ]

* Contents of net-misc/openssh-4.4_p1-r4:
















/usr/bin/slogin -> ./ssh













<output truncated for clarity>

A very useful file is the /etc/init.d/sshd file, which users can start, stop the ssh services.

sabayonx86 ~ # cd /etc/init.d

sabayonx86 init.d # ./sshd start

* Generating Hostkey…

Generating public/private rsa1 key pair.

Your identification has been saved in /etc/ssh/ssh_host_key.

Your public key has been saved in /etc/ssh/

The key fingerprint is:

a4:6a:f9:e6:cb:16:3d:eb:fb:97:56:9b:76:85:29:4d root@sabayonx86

  • Starting sshd …

After we have start the ssh service, we can now execute some ssh commands:

ssh into user ismail

sabayonx86 init.d # ssh ismail@sabayonx86


Last login: Tue Mar 31 11:04:58 2009

ismail@sabayonx86 ~ $

Note Sabayon’s default ssh settings prevent ssh into root user account.

To secure copy from root user to user ismail, type:

sabayonx86 ~ # scp hello ismail@sabayonx86:/home/ismail


hello 100% 40 0.0KB/s 00:00

To secure copy from user ismail to root, type:

sabayonx86 ~ # scp ismail@sabayonx86:/home/ismail/test.txt /root/


test.txt 100% 100 0.1KB/s 00:00

Verifying the sceure copy, type:

sabayonx86 ~ # ll test.txt

-rw-r–r– 1 root root 100 2009-04-10 12:13 test.txt


Leave a Reply

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

You are commenting using your 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


%d bloggers like this: