Skip to content

Secure Shell (SSH)

Secure Shell (SSH)

The acronym SSH stands for Secure Shell. There are a couple of ways that you can access most Linux/Unix systems. The most common way is to use a telnet program such as the one called telnet (for Unix and Windows). Accessing a shell account in this fashion though poses a danger in that everything that you do over that telnet session is visible in plain text on your local network, and the local network of the machine you are connecting to.

As one solution SSH was created to encrypt the data being sent over the network as well as provide an option that prevents passwords from being ever passed over the network. SSH can use several different forms of encryption, anywhere from 56 to 1024 bit. SSH has been ported to Operating Systems on several platforms including Linux, Microsoft Windows and Macintosh.

  1. Make sure the sshd is running in your Linux server. Preferably, you can edit global config file at /etc/ssh/ssh_config.

  2. We use PuTTY, a windows-based SSH client program to login from remote windows system. Type in your host IP address and choose Protocol SSH.

  3. Click connect and you will be prompted for username and password of any valid user on the remote machine.

SSH Auto Login

To be able to connect to an other linux box from one box without entering your password all the time do the folowing:

  1. login to the connecting computer as the user who will later connect to the other box.
    execute

    ssh-keygen -t rsa

    and accept all defaults. you must leave the passphrase blank as well, otherwhise you’re going to be asked for that all the time, so it doesn’t do any good

  2. Now you should have some files in your user’s home directory in .ssh/

    id_rsa
    id_rsa.pub
    known_hosts

  3. Now we need to copy id_rsa.pub (your public key) to the server you want to connect to. to connect to the server, you have to use the user you want to be logged in as later on.

    scp .ssh/id_rsa.pub username@server:~/

  4. Now connect to the server through ssh and add the contents of the copied file to your ~/.ssh/authorized_keys2

    if this is the first time you do that, then you have to create both, the directory and the file.

    ssh username@server
    cat id_rsa.pub >> .ssh/authorized_keys2
    exit

  5. And now you should be able to login through

    ssh username@server

    without a password prompt

Categories: Lesson, Linux, Server, Solution, Web Hosting.

Comment Feed

One Response



Some HTML is OK

or, reply to this post via trackback.