ssh - for Secure Shell - is a secure alternative to telnet and rlogin. Most modern Linux distributions will simply forbid you to run a telnet server anyway.

First create a user to be used when logging in over ssh

adduser foobar

If adduser didn't ask for a password, add that with

passwd foobar

This is important as some people will scream blood and murder if they see you connecting as root using ssh.

To install ssh do this:

  • Debian - apt-get install ssh
  • Gentoo - ssh is already there, edit /etc/ssh/sshd_config
  • Fedora - ssh is already there and working

The rest of this text will be for Debian Etch 4.0, as that is the distribution I use. I'm sure a lot of the commands will work in other distributions as well though

OpenSSH should be running after issuing apt-get install ssh. To check this run

ps -ef | grep ssh

The output should look similar to this if everything is working

root       764     1  0 10:51 ?        00:00:00 /usr/sbin/sshd
root       778   519  0 11:02 tty1     00:00:00 grep ssh

Now stop root from being able to log in by setting

PermitRootLogin no

in /etc/ssh/sshd_config. The setting is already in the file, but set to yes. After you have edited the sshd_config file you need to restart the ssh deamon

/etc/init.d/sshd restart

If you need to do something with root privileges you can just login using the account you created earlier (foobar) and then use su -. You will be asked for the root password, and then you can do anything root can.

To connect to the ssh daemon you need a ssh client like Putty.