How to add an SSH user to my Ubuntu 12 server to upload PHP files

Posted by user229209 on Server Fault See other posts from Server Fault or by user229209
Published on 2014-08-20T19:18:18Z Indexed on 2014/08/20 22:22 UTC
Read the original article Hit count: 270

I have an Ubuntu 12 VPS and wanted to create a user account to upload and download my PHP code. So when logged in as root I created a user "chris" and then created a directory /var/www/chris

I want "chris" to be able to upload and run files to the /var/www/chris directory. Permissions for the chris dir look like this:

drwxrwxr-x 2 root chris  4096 Aug 20 03:35 chris

As root I created a sample file called abc.php and put it in the chris dir. It worked fine when I test it in a browser.

I logged in as chris and uploaded a file called 1234.php. That did not work. I just got a blank PHP page. The code was identical in both files. So it is not the code.

The permissions now look like this:

-rw-r--r-- 1 root chris 59 Aug 20 03:34 1234.php
-rw-r--r-- 1 root root  49 Aug 20 03:21 abc.php

How do I alow the "chris" user to upload files and get them to work?

© Server Fault or respective owner

Related posts about linux

Related posts about ubuntu