What is SFTP?
SFTP, is the acronym for SSH File Transfer Protocol, or Secure File Transfer Protocol, is a protocol packaged with SSH that works in a similar way as FTP but over a secure connection. The advantage is the ability to leverage a secure connection to transfer files. In almost all cases, SFTP is preferable to FTP because of its underlying security features and ability to piggy-back on an SSH connection.
FTP is an insecure protocol that shouldn’t be used.
Enable PasswordAuthentication in the sshd config file
Backup the current sshd_config
1 2 3 |
# cp /etc/ssh/sshd_config /etc/ssh/sshd_config.orig |
Change it to READ-ONLY to ensure it don’t get overwritten
1 2 3 |
# chmod a-w /etc/ssh/sshd_config.orig |
1 2 3 |
# vim /etc/ssh/sshd_config |
Find the line with the phrase PasswordAuthentication and make it read:
1 2 3 |
PasswordAuthentication yes |
Save your new sshd_config file and then restart the host machine’s ssh service:
1 2 3 4 5 6 |
# service sshd restart Stopping sshd: [ OK ] Starting sshd: [ OK ] |
Connect to your host and login to your user account
To open an SFTP shell terminal as
1 2 3 4 5 |
# sftp <username>@<hostname> Connected to host. sftp> |