Openssh is meant to supply security to your systems. If you don't understand how to properly use it, you may have problems. Such problems are your responsibility. See our disclaimer. Please read the instructions below fully and carefully before you do any installation. Installation of the openssh software on a Solaris machine is lengthy, but straightforward. To get ssh and sshd running you need to install a number of packages. There are a number of places on the net with details of this procedure. One of the best is on the Sun Blueprints web pages (in pdf format) at Building and Deploying OpenSSH on Solaris[tm] Operating System (a pdf file) or the The OpenSSH Home Page
The seven pieces of software that may need to be on your system to use ssh properly are openssl, openssh, zlib, libgcc (if you have gcc-3.3.2 installed, you do not need to install libgcc), and optionally egd, prngd, perl (there is a perl with Solaris 9 and 10 in /usr/bin), and tcp_wrappers. You can either download the sources and do the compiles yourself if you have a C compiler installed and working or you can go to sunfreeware.com and get pre-compiled packages. If you are very concerned about your machine's security and don't want to trust software compiled by someone else, then it is best for you to compile the software yourself. It is also a great learning experience. The sources for these different programs are on sunfreeware.com or you can go to their home pages at http://www.zlib.org zlibhttp://www.perl.org perl http://www.aet.tu-cottbus.de/personen/jaenicke/postfix_tls/prngd.html prngd http://www.openssl.org openssl http://www.openssh.org openssh http://www.lothar.com/tech/crypto/ egd ftp://ftp.porcupine.org/pub/security/index.html tcp_wrappers You will also need to have the /usr/local/lib/libgcc_s.so.1 library from the libgcc-3.3 or gcc-3.3.2 packages. I have included support for the optional use of the tcp_wrappers program (using the so-called Advanced Method). This can help to restrict the use of ssh logins to those computers defined in the so-called hosts.allow and hosts.deny files when set up properly. Ssh logins can also be logged using this software. Installation StepsStep One: Getting the packagesTo install the version of openssh from sunfreeware.com, go to the main page and select the files for SPARC/Solaris 2.6 or SPARC/Solaris 7 at the right. Or, here are the files you need to download for Solaris 7 (get the similar files for Solaris 2.5(,1) (you will also need the snprintf package), or 2.6): openssh-4.1p1-sol7-sparc-local.gz
openssl-0.9.7g-sol7-sparc-local.gz
tcp_wrappers-7.6-sol7-sparc-local.gz (optional, but recommended (unless you are using IPV6 - see the tcp_wrappers listing for details on this issue) If you have already installed some of the above files, you can skip their downloads, but most are new.
Step Two: Installing the packages
# gunzip openssh-4.1p1-sol7-sparc-local.gz # gunzip openssl-0.9.7g-sol7-sparc-local.gz # gunzip zlib-1.2.1-sol7-sparc-local.gz # gunzip libgcc-3.3-sol7-sparc-local.gz (if you don't have gcc-3.3.2 installed) # gunzip tcp_wrappers-7.6-sol7-sparc-local.gz (again optional) # gunzip prngd-0.9.25-sol7-sparc-local.gz # gunzip egd-0.8-sol7-sparc-local.gz # gunzip perl-5.8.5-sol7-sparc-local.gz (optional if you already have perl) # gunzip snprintf-2.2-sol25-sparc-local.gz (for Solaris 2.5(.1) only) Then run as root: # pkgadd -d openssh-4.1p1-sol7-sparc-local # pkgadd -d openssl-0.9.7g-sol7-sparc-local # pkgadd -d zlib-1.2.1-sol7-sparc-local # pkgadd -d libgcc-3.3-sol7-sparc-local (if you don't have gcc-3.3.2 installed) # pkgadd -d tcp_wrappers-7.6-sol7-sparc-local (optional) # pkgadd -d prngd-0.9.25-sol7-sparc-local # pkgadd -d snprintf-2.2-sol25-sparc-local (for Solaris 2.5(.1) only) # pkgadd -d egd-0.8-sol7-sparc-local # pkgadd -d perl-5.8.5-sol7-sparc-local (optional) Once you have installed the packages above, you will have files in various subdirectories of /usr/local. The default location for the ssl files is in /usr/local/ssl. While these files were compiled to avoid the need to put directories like /usr/local/lib and /usr/local/ssl/lib in your LD_LIBRARY_PATH, it is possible that you may need to set this. You should now find ssh in /usr/local/bin and sshd in /usr/local/sbin. Make sure you have /usr/local/bin and /usr/local/sbin in your PATH environment variable. The perl scripts in the optional egd package (with .pl extensions) will look for perl in /usr/local/bin. If you are using the Sun perl, then the Perl programs will need to have /usr/bin at the beginning, while the sunfreeware Perl goes in /usr/local/bin.
Step Three: Getting Entropy
The next step in installation is to start the generation of entropy for use by openssl and openssh. This is done with the prngd program. To set this up, read the README.prngd file. Make sure you have /usr/local/sbin in your PATH first. Now go to your /var/log, /var/adm, or similar directories and look for some log files like messages, syslog, etc. Make sure you are logged in as root user and run
such as
which, if the egd package (see README.egd) is installed along with perl, will give a message like
ln -s /var/spool/prngd/pool /dev/egd-pool If you want to automatically start prngd at boot time, you will need to create a startup script appropriate to your setup.
# chown root /etc/init.d/prngd
will start the process if you want to do it by hand and
will stop the prngd daemon. You can test that this script actually starts the prngd daemon at boot time by rebooting your system and then doing to see if the process is started.
In openssh 3.5p1, a new security method is setup called privilege separation. The details can be found in the README.privsep file in the openssh source distribution. This method is now the default in openssh. Before doing anything else, you should read the above document and if you agree, implement these steps as root:
The default sshd_config file /usr/local/etc has the last line
If you do not do this and attempt to start up sshd, you will get error messages and the daemon will not start.
in it. Then, create the file /etc/hosts.allow file and put a line, for example, like sshd: ... a list of the IP numbers of machine you want to be able to communicate with your machine separated by commas ... in the file. We will test these entries later.
Step Six: Installing ssh and sshd
This is the final step. You should have read the README.openssl and INSTALL.openssl documents and you should also have read the openssh documents README.openssh and INSTALL.openssh. Each machine that you want to communicate with via the ssh client will need to have an sshd daemon running. But first, you need to run the following three lines to create the key information for the server machine. Again, make sure you have /usr/local/bin and /usr/local/sbin in your PATH. If you have been running sshd before and have keys in /usr/local/etc, running these commands will overwrite them. As root, enter
# ssh-keygen -t rsa1 -f /usr/local/etc/ssh_host_key -N "" # ssh-keygen -t dsa -f /usr/local/etc/ssh_host_dsa_key -N "" # ssh-keygen -t rsa -f /usr/local/etc/ssh_host_rsa_key -N ""and wait until each is done - this may take a few minutes depending on the speed of your machine. You might also want to study the /usr/local/etc/ssh_config and /usr/local/etc/sshd_config files to see if there is anything you want to configure differently.
#!/bin/sh pid=`/usr/bin/ps -e | /usr/bin/grep sshd | /usr/bin/sed -e 's/^ *//' -e 's/ .*//'` case $1 in 'start') /usr/local/sbin/sshd ;; 'stop') if [ "${pid}" != "" ] then /usr/bin/kill ${pid} fi ;; *) echo "usage: /etc/init.d/sshd {start|stop}" ;; esac
Date: Mon, 13 Jan 2003 14:43:53 -0600 (CST) From: "Mike's List"End of alternative script comment I then do
# chown root /etc/init.d/sshd to see if sshd is running. If sshd is running and you have set up tcp_wrappers the way you want, then you can test the system. Of course, you have to have another machine that has the ssh program installed so that you can try to communicate with the machine on which you just started sshd. See the OpenSSH documentation for further details. To test that tcp_wrappers is working, you can put a machine's IP address in hosts.allow and see if you can ssh to the server machine from the client and then take it out and see if access is denied. To repeat, if you have questions about the detailed use of any of these programs, please read the documentation first or go to their web sites. I do not want to know the security details of any of your systems and it would not be a good idea for you to tell me or anyone else. Security issues are very important and I strongly urge anyone to install as muchsecurity software as they can master and to keep a close eye out on the latest CERT and other vulnerability sites for announcements. I am fully open to constructive suggestions on how make these instructions clearer or better and will include reasonablecomments as they arrive.
© Copyright 2005 Steven M. Christensen and Associates, Inc.This page was last updated on April 26, 2005. |
||