Content:: Installing SSH
Installing Secure Shell (SSH)
Secure shell will be our remote access to the system. SSH will allow us
remote terminal access via command line, file transfer via SCP. Data in
secure shell is encrypted and mostly safe for typing in a password and
sending confidential information.
Secure shell runs off of port 22
# mkdir /root/dnld
# cd /root/dnld
Download Source : OpenSSH.org
At this point our ability to download and retrieve things are hard.. we will use wget and dl openssh via ftp.
# wget ftp://ftp5.usa.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-5.3p1.tar.gz
Decompress
# tar -xzf openssh-5.3p1.tar.gz
# cd openssh-5.3p1
Creating the SSH user
First create the sshd Group
# groupadd sshd Add the user to group sshd, with the comment "openssh user", point the home directory to /dev/null, disable ssh access for the user sshd.
# useradd -g sshd -c "openssh user" -d /dev/null -s /bin/false sshd
Compile
* we should probably do a configure prefix with this next go around*
# ./configure
# make
# make install
Create the startup script
/etc/init.d/
# nano /etc/init.d/sshd
# chmod 555 /etc/init.d/sshd
Create a symlink to our run time start up level (rc2.d)
# ln -s /etc/init.d/sshd /etc/rc2.d/S98sshd To start the ssh daemon now # /etc/init.d/sshd start
Secure shell runs off of port 22
# mkdir /root/dnld
# cd /root/dnld
Download Source : OpenSSH.org
At this point our ability to download and retrieve things are hard.. we will use wget and dl openssh via ftp.
# wget ftp://ftp5.usa.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-5.3p1.tar.gz
Decompress
# tar -xzf openssh-5.3p1.tar.gz
# cd openssh-5.3p1
Creating the SSH user
First create the sshd Group
# groupadd sshd Add the user to group sshd, with the comment "openssh user", point the home directory to /dev/null, disable ssh access for the user sshd.
# useradd -g sshd -c "openssh user" -d /dev/null -s /bin/false sshd
Compile
* we should probably do a configure prefix with this next go around*
# ./configure
# make
# make install
Create the startup script
/etc/init.d/
# nano /etc/init.d/sshd
#!/bin/sh
case "$1" in
'start')
/usr/local/sbin/sshd
;;
'stop')
/bin/kill `/usr/bin/head -1 /var/run/sshd.pid`
;;
'reload')
/bin/kill -HUP `/usr/bin/head -1 /var/run/sshd.pid`
;;
*)
echo "Usage: $0 { start | stop }"
exit 1
;;
esac
exit 0
Change who can run the script (read execute)# chmod 555 /etc/init.d/sshd
Create a symlink to our run time start up level (rc2.d)
# ln -s /etc/init.d/sshd /etc/rc2.d/S98sshd To start the ssh daemon now # /etc/init.d/sshd start


