w3resource logo


Remote administration ubuntu linux server

Secondary Nav

Remote administration with SSH

  • Ubuntu ships with an open source implementation of the SSH standard, called OpenSSH.
  • Using OpenSSH, you may securely control a remote computer, and transfer files.
  • For this, we must install the sshd component on the server if not already installed.

Install sshd

sudo apt-get install openssh-server
    Install the client component:

Some OS’s, like Mac OS X, come with an SSH client build-in. In Windows, use Putty. For Linux use the following command

sudo apt-get install openssh-client

Connect with SSH


w3r:~ psr$ ssh [email protected]

Authenticate the client using its public key

To avoid providing it with password every time you connect, you may authenticate the client using its public key;

Create the client’s public key if one doesn’t exist already:

ssh-keygen -t dsa

This creates your key pair and stores it in ~/.ssh/.

Preparing client

Open the file "~/.ssh/id_dsa.pub", copy contents if the file on the client, and paste it in the file "~/.ssh/authorized_keys" on the server. If later one does not exist, you have to create it. You can view the contents of the file with following command:

$ cat authorized_keys
HEHlu+U8GWd36E6AjjUzlcfreym5IRDv [email protected]

Connecting without password

Connect just like before, there should be no request for your password:

w3r:~ psr$ ssh [email protected]

Join our Question Answer community to learn and share your programming knowledge.

Solve these problems:

Java: How to convert a string to an integer in Java?

C#: Loops in c#

SQL: JOIN using more than 5 tables