Software >> OS >> Unix >> Solaris >> Packages >> How to install and configure OpenSSH

 

Example for Solaris x86 environment

Download following package from www.sunfreeware.com

  • openssh
  • libgcc

put in /opt

# gunzip /opt/opensshpkgfile.gz
# gunzip /opt/ligccpkgfile.gz

# pkgadd -d /opt/opensshpkgfile
# pkgadd -d /opt/libgccpkgfile

add path to /usr/local/bin

vi /etc/profile

add the following before export. PATH

PATH=/usr/local/bin:$PATH

# mkdir /var/empty

# chown root:sys /var/empty
# chmod 755 /var/empty
# groupadd sshd
# useradd -g sshd -c "sshd" -d /var/empty -s /bin/false sshd

ensure "Subsystem" parameter in /usr/local/etc/sshd_config points to correct path

# grep -i subsystem /usr/local/etc/sshd_config

Subsystem sftp /usr/local/libeec/sftp-server

# 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 ""

1) Disable SSH first
   # svcadm disable ssh

2) Editing /lib/svc/method/sshd and changing the paths to sshd and
ssh; especially, these lines:

(i)
SSHDIR=/usr/local/etc
KEYGEN="/usr/local/bin/ssh-keygen -q"

(ii)
'start')
         /usr/local/sbin/sshd

3) Enable SSH and check to see that it is working
   # svcadm enable ssh
   # svcs | grep ssh