learn more... Problem: The common UNIX remote access protocols - telnet, FTP and the Berkeley r-commands -- are unencrypted. Account and password information can easily be sniffed by unauthorized intruders and others who have been granted access to the same network. OpenSSH can be used to encrypt all remote sessions, thereby eliminating this vulnerability.
Step 1. Download and install the GNU C compilerSince all the software to install is in source code format and will have to be compiled, you need to make sure that you have a C compiler installed. If not, download and install the GNU C compiler. Point your web browser to http://gcc.gnu.org/install/binaries.html Click on the Solaris 2 - Sunfreeware link. Click on FTP/Mirror Sites on the left-hand column, and then choose one of the mirror sites (generally you will get better download performance from a mirror site). Click on Sparc/Solaris 8 on the right-hand column to see the list of software available for Solaris 8; scroll down and click on the latest release of gcc (3.2 as of this writing) Usually the latest gcc package will appear at the top of the page, e.g. gcc-3.2-sol8-sparc-local.gz. Download this package into /usr/local. Uncompress the .gz file, as shown below: $ cd /usr/local Use pkgadd to install the gcc binaries, as shown below: $ su This will install a new Solaris package named SMCgcc. The gcc binary will be placed in /usr/local/bin. Use pkginfo to verify the installation, as shown below: # pkginfo -l SMCgcc Step 2. Download, compile and install Zlib compression libraryPoint your web browser to http://www.gzip.org/zlib. Download the latest version of the ".gz" format of Zlib (1.1.4 as of this writing) into /usr/local. Use gunzip and tar to extract the source code, as shown below: $ cd /usr/local This will create a source-code directory structure such as /usr/local/zlib-1.1.4. Review the README and Makefile files. Configure, make and compile, as shown below: $ cd /usr/local/zlib-1.1.4 Step 3. Download, compile and install a random number generatorSome UNIX implementations, such as Solaris 8, do not provide a random number generator (e.g. /dev/random) out of the box. OpenSSL will automatically provide a random number generator if one is not found on the system, but it is highly recommended to use a higher quality random number generator, such as ANDIrand, PRNGD or EGD. Instructions are provided below for both ANDIrand and PRNGD. ANDIrand NDIrand is a simple package install (as opposed to a source-code compile) and creates the /dev/random and /dev/urandom devices at install time, from which SSL, one of the prerequisites to OpenSSH, obtains its random data. Point your web browser to http://www.cosy.sbg.ac.at/~andi/SUNrand/. Download the latest version of the package format (0.7 of this writing) into /usr/local. Use pkgadd to install the ANDIrand binaries as user root, as shown below: # cd /usr/local Note You will be prompted as to whether to continue to install the package with root privileges – enter "Y" to continue This will install a new Solaris package named ANDIrand and will also create the /dev/random and /dev/urandom files on your system. Use pkginfo –l to see the details for the install: # pkginfo -l ANDIrand PRNGD PRNGD is a source-code compile, which creates a prngd executable to be run as a daemon on the UNIX system. Point your web browser to http://www.aet.tu-cottbus.de/personen/jaenicke/postfix_tls/prngd.html Click on the prngd 0.9.27 link in the Download section to download the latest version of the prngd source-code (0.9.27 of this writing) into /usr/local Use gunzip and tar to extract the source code, as shown below: $ cd /usr/local This will create a source-code directory structure such as /usr/local/prngd-0.9.27. Review the 00README file for compile and install instructions Use your favorite editor to edit the "Makefile" file and make the following 2 changes: Scroll down to the section corresponding to your particular OS and uncomment the lines in that section. Scroll down to the section beginning with "# Move default locations" and select a default location for storing the prngd-seed and prngd.conf files. (if you don't specify a "new" default location, the default is /usr/local/etc/prngd). Become root $ su After saving changes to the Makefile, run make to compile the prngd source code: # make Copy the prngd executable to /usr/local/sbin # cp -p ./prngd /usr/local/sbin Copy a default prngd.conf file. There are sample prngd.conf files for numerous OS' under the contrib subdirectory. The location of the prngd.conf file should be consistent with what you specified earlier when you edited the Makefile. In the following example, a sample Solaris prngd.conf file is copied to the default location of /usr/local/etc/prngd: # pwd Note The Solaris-8 directory simply has instructions to use the conf file from the Solaris-7 directory. Use the following command to generate an initial "seed" for PRNGD: # cat /var/adm/messages /var/log/syslog > /usr/local/etc/prngd/prngd-seed Start PRNGD: # /usr/local/sbin/prngd /var/run/egd-pool Since PRNGD is a daemon, you'll want to be sure to create a startup script and place it in the appropriate OS startup directory so the system will automatically start PRNGD on system startup. There are sample startup scripts for most OS' in the "contrib" sub-directory: # pwd Step 4. Download, compile and install OpenSSLPoint your web browser to http://www.openssl.org/source/ Download the latest version of the source code (0.9.7b as of this writing) into /usr/local Use gunzip and tar to extract the source code, as shown below: $ cd /usr/local This will create the source-code directory structure, such as /usr/local/openssl-0.9.7b Review the README and INSTALL files Configure, make and compile, as shown below: $ ./config Step 5. Download, compile and install OpenSSHPoint your web browser to http://www.openSSH.com/portable.html Download the latest version of the source code (3.6.1p2 as of this writing) into /usr/local Use gunzip and tar to extract the source code, as shown below: $ cd /usr/local This will create a source-code directory structure such as /usr/local/openSSH-3.6.1p2. Review the README and INSTALL files. Issue the following commands to configure, make and compile OpenSSH. The default options, such as where the binaries will be installed, can be changed when the configure script is run. The options can be displayed by running ./configure –help. $ cd /usr/local/openSSH-3.6.1p2 The OpenSSH software requires that we have an sshd UNIX account defined before it will start the "sshd" daemon. If we do not do this before we run make install, we will see the message "Privilege separation user sshd does not exist" at the end of the make install output. Since we do not want anyone logging in directly to this account, we should make it a non-interactive account. The following command creates the sshd user with a user id of 1100 and an invalid shell that prevents anyone from logging in directly: # useradd -c "sshd owner" -d /var/empty \ If the home directory for this account, /var/empty, does not exist, it should be created as follows: # mkdir /var/empty As an extra measure of securing this account, issue the following command to lock it: # passwd -l sshd Once the "sshd" user is created, OpenSSH can be installed as shown below. # make install At the end of the make install output, you should see messages similar to the following: Generating public/private rsa1 key pair. Congratulations – you have successfully installed the OpenSSH software - both client-side and server-side. If the machine on which you installed will function as an OpenSSH client only (i.e., will initiate connections to remote systems, but not accept remote connections), then we're ready to test and verify that the installation is correct. If the machine will be an OpenSSH client and server (will accept remote connections) or an OpenSSH server only, there are a few more steps to perform. Step 6. Configure the sshd_config configuration fileNow that the OpenSSH software is installed, we need to make sure the server configuration is set up correctly. The configuration file for the SSH daemon is usually located in /etc/ssh and is called sshd_config. You can leave most of the settings alone as the defaults should work for most installations. However, the following should be verified to make sure they are set correctly.
Step 7. Configure auto-start of sshd daemon (for OpenSSH server)The OpenSSH server daemon, sshd, must be started before OpenSSH clients will be allowed to connect. You can simply launch the sshd daemon as root and place it in the background as follows: # /usr/local/sbin/sshd & You should also place this command in a startup script so that it launches each time the system is booted. For example, on Solaris 8 we could use an editor to insert and save the above command in the file /etc/init.d/sshd_start, then issue the following commands: # ln /etc/init.d/sshd_start /etc/rc3.d/S95sshd Now each time the system is booted, the sshd daemon will start automatically as user "sshd". |
|||||||||||||||
Disclaimer
1) E-articles is not responsible for the information contained by this article as well for any and all copyright infringements by authors and writers. E-articles is a free information resource. If you suspect this article for any copyright infringement, please read the terms of service and contact us to investigate the problem.
2) E-articles is not responsible for inaccuracies, falsehoods, or any other types of misinformation this article may contain and will not be liable for any loss or damage suffered by a user through the user's reliance on the information gained here. link to this article |