Install SSH and SFTP on Ubuntu or Linux Mint

July 3, 2012 by
Filed under: command line, HowTo, linux, Linux Mint, Ubuntu 

If you've been using Linux or Unix for a long time, then you're probably familiar remote technologies like rlogin, FTP, and Telnet. These are all wonderful technologies for using a computer remotely, but they are notoriously insecure due to your login credentials being transmitted over the Internet in plain text format.

SSH, which stands for Secure Shell, is a more secure replacement for rlogin and Telnet. Similarly, SFTP stands for Secure File Transfer Protocol. As the name implies, it's a more secure version of FTP.

Installing OpenSSH

OpenSSH was developed by the OpenBSD project and provides both SSH and SFTP server components. Binary packages are available in the repositories for Ubuntu and Linux Mint. In either of these distros, you can install it with:

sudo apt-get install openssh-server

That's all it takes to install it on your system.

Affiliate Link

Using SSH

You should now be able to log in to your system remotely by using the ssh command followed by the IP address. For example, if your remote computer's IP address is, you can log into it with:


If you'd like to log in with a different user name than the one on your local machine, for example linerd, use:

ssh -l linerd

Note that the switch is a lowercase L, (short for login name).

Using SFTP

The basic usage of SFTP is similar to SSH. To access your remote computer with SFTP use the sftp command followed by your remote IP address. So if your remote machine's address is, use


If your remote user name is different from your local user name you can use a slightly modified version of the command. As an example, if your remote user name is linerd, you would use it like this:

sftp [email protected]

Once you've accessed your remote machine through SFTP, the commands are similar to regular FTP.

More information

You can get information about both SSH and SFTP from the manual pages after you install the package.

For SSH:

man ssh


man sftp

This post originally appeared at


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>