Previous Page | Next Page

  1. Introduction
  2. About Linux
  3. Installation and getting started
  4. Logging in and out
  5. Basic Linux Commands
  6. Linux Files and File Permissions
  7. Linux Directory Structure
  8. Finding Files
  9. Linux Help
  10. Setting Time
  11. Devices
  12. Tips
  13. Accessing Other Filesystems
  14. Accessing Removable Media
  15. Making and Managing Filesystems
  16. Emergency Filesystems and Procedures
  17. LILO and Runlevels
  18. Init
  19. Environment, Shell Selection, and Startu
  20. Linux Kernel
  21. Package Installation and Printing
  22. Configuration, Logging and CRON
  23. Keys and Terminal Configuration
  24. Sound Configuration
  25. Managing Users
  26. Passwords
  27. Process Control
  28. Configuration and Diagnostic Tools
  29. Overall Configuration
  30. Using PAM
  31. Basic Network Setup
  32. Tools and Terms
  33. Novell and Printing
  34. Inetd Services
  35. Xinetd Services
  36. Other Network Services
  37. FTP and Telnet
  38. Samba
  39. Identd (auth)
  40. X Configuration
  41. X Use
  42. Using X Remotely
  43. X Documentation
  44. DNS
  45. DHCP and BOOTP
  46. Apache
  47. NFS
  48. PPP
  49. Mail
  50. Routing
  51. IP Masquerading
  52. Proxy Servers and ipchains
  53. UUCP
  54. News
  55. NIS
  56. Network Security
  57. Secure Shell
  58. Text Processing
  59. Shell Programming
  60. Emacs
  61. VI
  62. Recommended Reading
  63. Credits

Linux Secure Shell

Much of this information is from the secure shell website and is intended as a supplement for introductory purposes and an aid to enable users to get secure shell running.

Why you should use secure shell

When a user logs on to a Linux system using the standard telnet or ftp services, the password during the logon process is sent in the clear. Anyone with a network sniffer can intercept the password and then break into the system. Secure shell uses password encryption and implements several other important security measures which allows users to remotely logon to Linux systems without worrying about security.

Getting secure shell

Refer to the weblinks section under "Sites for specific programs" to locate secure shell documentation and downloadable copies of secure shell. Secure shell is a commercial product for corporate use, but may be used by individuals and educational institutions without charge. The secure shell website contains a FAQ section from which you can link to mirror sites for documentation and downloading.

Installation on Linux

Place the secure shell downloaded package in /usr/local/source and issue the following commands:

  1. Unpack the file with "tar xvzf ssh-2_2_0_tar.gz". The directory "ssh-2.2.0" will be created.
  2. Enter the directory with the command "cd ssh-2.2.0"
  3. Type "./configure" to configure the package for the build.
  4. Type "make" to build the package.
  5. Type "make install" to install the package.
  6. Optionally type "make clean-up-old" to remove *.old files.

This assumes you are installing from a source tarred and zipped file.

Installation on a Windows platform

  1. Double click on the SSHWin-2_2_0.EXE file that you downloaded. An install wizard will begin.
  2. Perform the install, reading and accepting the license agreement. The copy I tested was a 30 day evaluation copy.
  3. Click on "Start" -> "Programs" -> "SSH Secure Shell" -> "Secure Shell Client" to start the secure shell program. This program has an excellent help menu that can be activated by selecting "Help" -> "Contents".
  4. Click on "Edit" -> "Settings" , select "Connection" and enter your hostname and user name then click OK.
  5. Click on "Edit" -> "Settings" , select "User Keys" and click on the "Generate New Key Pair" button to generate a set of keys. You will need to enter a password phrase later required key authentication. This will take a few minutes, so this is a good time to start services on the host side.
  6. Start SSH on the host side. On Linux you can type "/usr/local/sbin/sshd2" on the command line. The program is normally installed in the /usr/local/sbin directory. To get the program to start at bootup, the above command may be placed in the /etc/rc.d/rc.local file.
  7. Logon from the Windows side by pressing ENTER or selecting "File" -> "Connect".
  8. Enter your Linux user name and the user password for your Linux account.
  9. Upload the public key file generated earlier to the users home directory ~/.ssh2 directory.
    1. Click on "Edit" -> "Settings" , select "Host Settings", and click "Browse" to locate the public key file generated earlier. It may be in C:\Program Files\SSH Communications Security\Users\computername\userkeys\user.pub.
    2. Click on "Window" -> "NewFileTransfer"
    3. Select "View" -> "Show Hidden Files"
    4. Enter the /$HOME/.ssh2 directory.
    5. Select "Operation -> "Upload"
  10. Create a file called "authorization" in the users $HOME/.ssh2 directory. You may use an editor with the string "Key" followed by the name of the file you upload ed or type the following:
    1. cd ~/.ssh2
    2. echo "Key username.pub" > authorization
  11. The next time you login, if you enter your password in the "Connect to remote Host" dialog box, you are using password authentication and must enter your Linux user's password. If you press ENTER when you see this box, you will be able to enter your pass phrase to use the private key for authentication.

Congratulations, you are done, unless you are interested in setting your Linux computer as a client. Also, if you are interested in using your Windows computer as a host, you may need another program (if one exists) since the above program is a Windows SSH2 client program.

Configuring SSH for Linux

This section and the sections below are useful if you want to connect from one Linux computer to another, or use a Linux on the client side. The following steps are documented in the README file and the SSH2.QUICKSTART file of the SSS package, but there are additional comments here which may be of some use. It is recommended, however, that you rely on the package documentation for correct documentation since programs change and the procedures may change.

You will be generating key sets to allow secure communications in the following steps. Keep in mind that on the server side, you will need a public key and an authorization file, and on the client side, you will need a private key and an identification file. The public key on the server and private key on the client must be a matching pair of keys as generated by the SSS-key gen program. You should know that you can use either host based authentication or user based authentication. If you use user based authentication, key files mentioned below must be set up in the user's home directory. If host based authentication is used, the host that is being authenticated, must have the appropriate key files. The instructions below set up user authentication.

  1. Be sure your computer has the device "/dev/random" which is used to generate keys. If it does not, you will need to use the ssh-keygen2 utility to generate security keys.
  2. Set up the following files (Note: The ~ symbol indicates the user's home directory):
    • Files needed on the client host to login to a remote server host.
      1. ~/.ssh2/id_ds a_1024_a and ~/.ssh2/id_ds a_1024_a.pub - The first is a 1024 bit DSA private key and the second is a 1024 bit DSA public key. the second key may be distributed to other computers that you will want to log in on. The first key must be held only by the user.

        Create these files while logged in as the user you want to create them for and type:

        SSS-key gen

        You will need to enter a password phrase. It will create the two files in the location shown above.

      2. ~/.ssh2/identification - Lists the private keys to be used for authentication. the contents of the file should be:

        # identification
        id key id_ds a_1024_a

        This can be created using an editor or by running the ssh-pubkeymgr script program. The following commands will also create this file:
        1. cd ~/.ssh2
        2. echo "id key id_ds a_1024_a" > identification
    • Files needed on the server host to enable users to login from a remote client host.
      1. Step 1, above, should be repeated on the server host to set up the user's .ssh2 directory, using a optionally different password phrase. Then the public key, id_ds a_1024_a.pub, must be copied to this directory on this server host. Perform step 2, above, if you want to use the remote machine to logon to other remote machines.
      2. Copy the public key file, "~/.ssh2/id_ds a_1024_a.pub" from the local host above to this remote host and call it "serverhostname.pub", placing it in the ~/.ssh2 directory.
      3. ~/.ssh2/authorization - Anyone holding any of the matching private keys to this public key may log in as the user whose public key their private key matches.
        	# authorization
        	Key serverhostname.pub
        	
        This can be created using an editor or by running the SSS-pubkeymgr script program. The following commands will also create this file:
        1. cd ~/.ssh2
        2. echo "Key serverhostname.pub" > authorization

Additional configuration files, that you may not need to be concerned about

  1. Files that may need configured:
    • ~/ssh2/hostkeys/key_xxxx_yyyy.pub - The public host key for port xxxx of the host yyyy.
    • ~/.ssh2/SSS_config - The client configuration file similar to the file /etc/ssh2/ssh2_config.
    • ~/.ssh2/knownhosts/xxxxyyyy.pub - Public host keys where users will log in from for host based authentication. The ~./shosts or ~/.rhosts file must also be set up. See the SSH documentation for more information on this subject.
    • /etc/ssh2/knownhosts/xxxxyyyy.pub
    • /etc/hosts.equiv and /etc/shosts.equiv. See the ssh2 man page
    • ~/rhosts and ~/shosts
  2. Files that should already be configured:
    • /etc/ssh2/ssh2_config - This file is created by the "make install" command issued earlier.
    • /etc/ssh2/hostkey.pub and /etc/ssh2/hostkey - Should be created by the "make install" command issued earlier, but it may be created by issuing the commands:
      1. rm /etc/ssh2/hostkey*
      2. ssh-keygen2 -P /etc/hostkey

See the ssh2_config and sshd2_config man pages for more configuration file format information.

About SSH2

SSH is now using SSH2 which has improved security over SSH1. The binary programs include:

  • ssh2 - The secure shell client which replaces rlogin and rsh.
  • sshd2 - The secure shell daemon.
  • sftp2 - The secure shell FTP client.
  • sftp-server2 - The secure shell FTP server which is executed from the sshd2 daemon program.
  • scp2 - The scp client. I have no idea what scp is, as of right now.
  • ssh-keygen2 - A utility for generating security keys.
  • ssh-add2 - Adds identities to the authentication agent.
  • ssh-agent2 - The authentication agent.
  • ssh-askpass2 - X utility for quering passwords.
  • ssh-signer2 - Signs host based authentication packets.
  • ssh-probe2 - Probes a network for ssh2 servers.
  • SSS-pubkeymgr - A script file utility program used to generate public keys.
  • SSS-chrootmgr - A utility that makes it easier to set the chroot environment up.

Additional man page is "ssh2_config".