Setup sftp

On cross platforms, Secure FTP allows transfer to and from server. This Tutorial Explain SFTP configuration.

User setup:

To access the server first step is to setup authenticate user.
Lets set password for www-data user

sudo passwd www-data
ADVERTISEMENT

Sample Output:

^_^[root[email protected]:~]# sudo passwd www-data
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully

Setup Login Shell :

Check Login shell for the user using grep www-data /etc/passwd

^_^[[email protected]:~]# grep www-data /etc/passwd
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin

When its nologin in the output we need to change the login shell

To setup login shell change /usr/sbin/nologin to /bin/bash

^_^[[email protected]:~]# vim /etc/passwd
www-data:x:33:33:www-data:/var/www:/bin/bash

This completes sftp setup.

Test SFTP Setup:

SSH Testing:

ssh [email protected]

Filezilla Testing:

Host: server-ip-address
user: www-data
pass: your-password
port: 22