$ sudo apt-get install ssh-server -y
Configure FTP on
sshd_config
/etc/ssh/sshd_config
$ sudo vi /etc/ssh/sshd_config
find and comment
#Subsystem sftp /usr/lib/openssh/sftp-server
and append the following to file
Subsystem sftp internal-sftp
Match group ftpaccess
ChrootDirectory %h
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp
restart ssh service
$ sudo systemctl restart ssh
$ sudo addgroup sftp
$ sudo useradd -m sftpUser -g sftp
eg. create user is
sftpUser
and assign tosftp
group
$ sudo passwd sftpUser
...
New password:
Retype new password:
passwd: password updated successfully
$ sudo chmod 700 /home/sftpUser # /home/<username>
All Done
$ sftp [email protected]<ip or hostname>
if your has the same problem as below
$ [email protected]<ip or hostname>: Permission denied (publickey).
Connection closed
Connection closed.
change
sshd_config
/etc/ssh/sshd_config
PasswordAuthentication no
# to
PasswordAuthentication yes
$ sudo systemctl restart ssh
test login via sFTP again
$ sftp [email protected]
[email protected]'s password:
Connected to xx.xx.xx.xx.
sftp>
test connect via FileZilla