Share your story
The central voice for Linux and Open Source security news
Home News Topics Advisories HOWTOs Features Newsletters About Register

Sign up!
EnGarde Community
What is the most important Linux security technology?
Linux Events
Linux User Groups
Link to Us
Security Center
Book Reviews
Security Dictionary
Security Tips
White Papers
Featured Blogs
All About Linux
DanWalsh LiveJournal
Latest Newsletters
Linux Security Week: March 30th, 2015
Linux Advisory Watch: March 27th, 2015
LinuxSecurity Newsletters
Choose Lists:
About our Newsletters
RSS Feeds
Get the LinuxSecurity news you want faster with RSS
Powered By

OpenSSH Print E-mail
User Rating:      How can I rate this item?
Source: Chris Parker - Posted by Chris Parker   
Learn tips and tricks Telnet is a popular way to access a remote system, unfortunately, it is incredibly insecure. Telnet, along with rlogin, rcp, and rsh, are known to be insecure ways of connecting to a remote system. They are unencrypted and send login information in plain text. Because of this, anyone between the telnet client and the telnet server can intercept the packets and gain private information. Secure SHell (SSH) is a replacement for these types of remote access schemes. OpenSSH (the version of SSH that is talked about in this tip) uses Secure Socket Layer (specifically OpenSSL) to create an encrypted tunnel between the SSH client and the SSH server. With this tunnel in place, everything sent between the two computers is encrypted, so if a packet sniffer between the two systems is capturing packets, it will not be able to make use of the data collected.


Download and install the rpms:



After reading man sshd, although it is probably correct as is, read /etc/ssh/sshd_config. Since OpenSSH uses TCP_WRAPPERS, add the hosts to be allowed to use SSH into /etc/hosts.allow and block everyone else in /etc/hosts.deny. An example for /etc/hosts.allow that allows everyone in the 192.168.1 subnet to use SSH is:


In /etc/hosts.deny, add this line to default block everyone from using Secure SHell:

  sshd: ALL

Start sshd by running:

  /etc/rc.d/init.d/sshd start

To use the SSH client, first you must make a key. Run


ssh-keygen creates a public and private key to be used for encryption and decryption of data sent through the encrypted tunnel. Here is a sample run of ssh-keygen:

  [sabaka00@CC989892-A sabaka00]# ssh-keygen
  Generating RSA keys:  ...............................ooooooO...ooooooO
  Key generation complete.
  Enter file in which to save the key (/sabaka00/.ssh/identity):
  Enter passphrase (empty for no passphrase):
  Enter same passphrase again:
  Your identification has been saved in /sabaka00/.ssh/identity.
  Your public key has been saved in /sabaka00/.ssh/
  The key fingerprint is:
  c2:ff:74:c5:e5:7d:b7:23:56:bb:11:8c:8a:97:77:7a sabaka00@CC989892-A
  [sabaka00@CC989892-A sabaka00]#

For more information about ssh-keygen, read man ssh-keygen.

Once you have created the public and private keys, copy the public key, normally found at $HOME/.ssh/, to the host that is going to be connected to. The key should be in $HOME/.ssh/authorized_keys of the user that will be logged into on the remote system. Make sure the public key is on a single line in the authorized_keys file.


After the keys are set up on the local and remote systems, connect to an SSH server like this:

  ssh -l <Login name> -i <identity file> host

An example would be:

  [sabaka00@CC989892-A sabaka00]$ ssh -l sabaka00
  sabaka00@'s password:
  Last login: Fri Aug  4 22:53:42 2000 from localhost.localdomain
  [sabaka00@ sabaka00]$

Read man ssh for more information about the different command-line options for ssh.

More Information

Only registered users can write comments.
Please login or register.

Powered by AkoComment!

< Prev   Next >


Latest Features
Peter Smith Releases Linux Network Security Online
Securing a Linux Web Server
Password guessing with Medusa 2.0
Password guessing as an attack vector
Squid and Digest Authentication
Squid and Basic Authentication
Demystifying the Chinese Hacking Industry: Earning 6 Million a Night
Free Online security course (LearnSIA) - A Call for Help
What You Need to Know About Linux Rootkits
Review: A Practical Guide to Fedora and Red Hat Enterprise Linux - Fifth Edition
Yesterday's Edition
Partner Sponsor

Community | HOWTOs | Blogs | Features | Book Reviews | Networking
 Security Projects |  Latest News |  Newsletters |  SELinux |  Privacy |  Home
 Hardening |   About Us |   Advertise |   Legal Notice |   RSS |   Guardian Digital
(c)Copyright 2015 Guardian Digital, Inc. All rights reserved.