Tool-BarfreeBSD ArticlesSearch Our SiteHOMEfreeBSD LinksContribute to FreeBSD HelpFreeBSD FilesFreeBSD Script Corner

Setting up and Using SSH with FreeBSD

Features in SSH :

  For those of you who are not familiar with what SSH does, let me explain a little about the importance of using this port. One of the things that SSH does is that it encrypts the connection between two computers, unlike telnet which passes the data in straight text format. When using telnet, it is possible that your connection can be sniffed (checked out by others) and others could possibly get your login and passwords. If you use SSH, it is hardier for someone to get the information and decrypt this information, thus stopping others from gaining access to your machine, thanks to the encryption that SSH uses between the two machines.

Getting Started with Installing SSH :

  To install SSH, do the below to get them installed and ready to setup on your machine. We will be doing this via the ports collection.

        cd /usr/ports/security/ssh/
        make all install clean

Disabling telnetd on your FreeBSD machine :

  You don't have to disable telnetd on your FreeBSD box, but if you want to make your machine alot more secure, then follow the following on how to do this. First thing that you'll need to modify is the inetd.conf file,  /etc/inetd.conf as follows:
       cd /etc
       vi inetd.conf

  First thing you need to do, is look for the line in the inetd.conf file that has telnetd then place a # in front of it, and comment it out.
      # telnet stream tcp   nowait root  /usr/libexec/telnetd  telnetd

NOTE:  If your doing this on a remote machine, it would be a good idea to test SSH first and make sure it's working before disabling telnetd, otherwise you will be locking yourself out of this machine.

Putting SSH to work :

  After you have installed SSH from the ports collection, you need to reboot the machine. Or if you want to start sshd without rebooting, you can either reboot and it will start automatically, or you can invoke sshd manually by running the following as root:    /usr/local/sbin/sshd

  Now that the SSH is running, now try connecting to your machine using SSH by doing the following:   ssh

  Where is the name of your machine. You should then see something like this:
        Host key not found from the list of known hosts.
        Are you sure you want to continue connecting (yes/no)?

  If you want to connect to the host (which in this case you do) type 'yes' at the prompt. It will put a key in ~/.ssh/my_hosts file, and you won't be prompted again; it will simply connect you.

  If you are going to be connecting via Windows 95/98 or Windows NT machines you can use a program like Secure CRT or TTSSH to connect to your box via SSH. Check out the below links below for more info.

Written By: GhostRdr

© 1997 - 20013 Defcon1, , Copyrights for all materials on this web site are held by the individual authors, artists, photographers or creators. Materials may not be reproduced or otherwise distributed without permission of and the content's original author.

Tool-Bar-2Defcon1  Webmail