Using DreamWeaver with SFTP on Ubuntu EC2 instances

EC2 Linux Ubuntu VPS is not configured for connections with a password by default. This is a requirement for using SFTP with Adobe DreamWeaver.

This is a how to configure the VPS server to accept connections using SFTP with password authentication.

Allow login with password

Open the SSHD config file:

nano /etc/ssh/sshd_config

Find the line:

PasswordAuthentication no

and change it to:

PasswordAuthentication yes

Stop the user from watching other areas of the server

NB: This is currently not working:

At the end of the file add the following sentences:

Match Group sftpusers
ChrootDirectory /var/www/%u
ForceCommand internal-sftp

Save the file. Then restart the SSH server.

service ssh restart

Create the restricted SFTP user group

You will now create a SFTP group:

sudo addgroup sftpusers

Create the SFTP only user and add him to the group sftpusers

Replace “USER” with your username.

useradd -d /var/www/ -s /usr/lib/sftp-server -M -N -g sftpusers "USER"

Now give “USER” a password:

passwd "USER"

Then add the user to another group:

usermod -a -G www-data "USER"

Create the user homedir and website root dir

We are starting with creating the folder that will be the home directory for the user and the root folder for the website.
Replace “DOMAIN” with your domain.

sudo su
cd /var/www/
mkdir -p /var/www/"DOMAIN" /var/www/.ssh
chown "USER":sftpusers /var/www/"DOMAIN" /var/www/.ssh
chown "USER":www-data /var/www/"DOMAIN" /var/www/.ssh
sudo chown -R www-data /var/www
chmod 700 /var/www/.ssh

Create the website in apache.

cd /etc/apache2/sites-enabled
ls

Duplicate and modify an existing  site or create at new site
as described in this how to:
How to add a websites to EC2 Ubuntu LTS instances

Add a shell to the group

nano /etc/shells

Add the following to the bottom of the file and save:

/usr/lib/sftp-server

References

How to set up an SFT user to login with a password to an EC2 ubuntu server?

Setting up SFTP on Ubuntu

Ubuntu SFTP-Only Account How-to