SSH Authentication with public-key

No Comments »

To create the private and public keys type on the unix prompt:

$ ssh-keygen

You can use the default location, and not use a passphrase. The keys will be created in the directory:

/home/<username>/.ssh/

Inside this directory you’ll find two files id_rsa (the private key), and id_rsa.pub (the public key).

Login into the remote server and created the ‘.ssh’ under the home directory. Ensure the directory only has permissions to the owner.

$ ssh <remote username>@<remote hostname>
$ mkdir .ssh
$ chmod 700 .ssh

Go back to your host server and copy the public key to the remote server.

$ sftp <remote username>@<remote hostname>
$ put /home/<username>/.ssh/id_rsa.pub ./ssh

Login into the remote server again and rename the public key to authorized_keys. Also ensure the file only has permissions to the owner.

$ ssh <remote username>@<remote hostname>
$ cd .ssh
$ mv id_rsa.pub authorized_keys
$ chmod 600 authorized_keys

Next time you ssh to the remote server, you should be logged in automatically without needing to enter a password.

OpenSSH for Ubuntu Quickstart Guide

, 1 Comment »

OpenSSH (Open Secure Shell) is a set of computer programs providing encrypted communication sessions over a computer network using the SSH protocol.

Installing OpenSSH for Ubuntu

From the Ubuntu desktop:

  1. Go to System > Administration > Synapatic Package Manager
  2. Search for “openssh-server” and “Mark for installation”
  3. Click on the “Apply” to install

From the command line:

$ sudo apt-get install openssh-server

Configuration Files

The configuration files for OpenSSH is located in:

/etc/ssh

Disabling SSH Root Logins

Edit the /etc/ssh/sshd_config file and set the PermitRootLogin parameter to no.

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in