Enable a sftp-server with openssh-server

If you want to use FTP commands through a secured login session, here is a solution : sftp. SFTP can be activated on a remote server running openssh-server so that you will be able to run any  FTP commands.

All you have to do is to add the following line into the openssh server configuration file /etc/ssh/sshd_config :

root@localhost:~# echo “Subsystem       sftp    /usr/libexec/openssh/sftp-server” >> /etc/ssh/sshd_config

Reload you configuration file :

root@localhost:~# /etc/init.d/sshd reload

To open a ftp session :

sftp username@server_name

You will be in your default home directory. For instance, if you want to download a file on your own computer, use the get command.

To leave your session, just type quit.

Advertisements

2 thoughts on “Enable a sftp-server with openssh-server

  1. Just a note, sftp it is not FTP over ssh. It is a complete different protocol.
    FTP -> File transfer protocol
    FTPS -> FTP over SSL
    SFTP -> Secure File Transfer Protocol | Which is different from FTP and also runs over SSH or over SSL independently

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