Ubuntu Home Server – Part 2: Remote Access (via ssh)

This part describes how to set up remote access to the server.

As after installation the display, mouse and keyboard have to be removed and the server has to be located in a better location i had to set it up for remote access.

The basic setup was already done in Part 1. What i will do here is to set it up a bit more safe because i also want to have access to the system via internet.

Steps to be taken:

  • sudo apt-get install openssh-server

  • create a key pair if you do not already have one. A simple way to do this is to open a terminal and type ssh-keygen
  • copy the public part (normally named id_rsa.pub) of the key to the server and append it to the authorized_keys file which is located under /home/USERNAME/.ssh/authorized_keys or if it not yet does exist has to be created there
  • edit the configuration of the ssh service. Here it much depends on what you want. As mentioned, i want to have a secure server and change some of the settings accordingly. Following is an extract of the config file which the changes i made in bold


    # Package generated configuration file
    # See the sshd_config(5) manpage for details

    ...

    # Authentication:
    LoginGraceTime 120
    PermitRootLogin no
    StrictModes yes

    ...

    # Change to no to disable tunnelled clear text passwords
    #PasswordAuthentication yes
    PasswordAuthentication no

    ...

  • after having saved the above changes i restart the ssh service with a

    /etc/init.d/ssh restart

If everything is working fine now, you should be able to access the server via a

ssh SERVERIP -l USERNAME

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: