Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I've been trying to wrap my head around the permissions system on Linux, but I'm having some problems. I setup a web server using the Tuxlite.com script and everything works fine, as long as I login as root to do everything. When I create a new user (to give to a friend so he has SFTP access to his website), I always get the permission denied errors.

When I login as root and navigate to a website's public_html folder , and run a ls -l command, I get:

drwxr-xr-x  2    513     513  4096 Sep  6  2010 cgi-bin
-rw-r--r--  1 nobody nogroup   418 Sep 24 17:18 index.php
-rw-r--r--  1 nobody nogroup 19929 Jan 18  2013 license.txt
-rwxr-xr-x  1    513     513 13954 Sep 15  2006 logo.jpg
-rw-r--r--  1 root   root        2 Apr  9  2013 mu-a2015d17-2c5383c6-75806bff-31148a7c.txt
-rw-r--r--  1 nobody nogroup  7183 Nov 20 16:21 readme.html
-rw-r--r--  1 nobody nogroup  4892 Oct  4 07:12 wp-activate.php
drwxr-xr-x  9 nobody nogroup  4096 Dec 12 09:01 wp-admin
-rw-r--r--  1    513     513  1354 Jul  5  2012 wp-app.php
-rw-r--r--  1    513     513   226 Apr 21  2011 wp-atom.php
-rw-r--r--  1 nobody nogroup   271 Jan  8  2012 wp-blog-header.php
-rw-r--r--  1 nobody nogroup  4795 Sep  5 18:38 wp-comments-post.php
-rw-r--r--  1    513     513   244 Apr 21  2011 wp-commentsrss2.php
-rw-r--r--  1 nobody nogroup  3087 Oct 24 15:58 wp-config-sample.php
-rw-r--r--  1    513     513  3576 Apr 14  2013 wp-config.php
drwxr-xr-x  7 nobody nogroup  4096 Dec 12 09:01 wp-content
-rw-r--r--  1 nobody nogroup  2932 Sep 24 17:18 wp-cron.php
-rw-r--r--  1    513     513   246 Apr 21  2011 wp-feed.php
drwxr-xr-x 12 nobody nogroup  4096 Dec 12 09:01 wp-includes
-rw-r--r--  1 nobody nogroup  2380 Oct 24 15:58 wp-links-opml.php
-rw-r--r--  1 nobody nogroup  2359 Oct 24 15:58 wp-load.php
-rw-r--r--  1 nobody nogroup 31909 Dec  3 12:12 wp-login.php
-rw-r--r--  1 nobody nogroup  8235 Nov 13 03:58 wp-mail.php
-rw-r--r--  1    513     513   413 May 18  2012 wp-pass.php
-rw-r--r--  1    513     513   224 Apr 21  2011 wp-rdf.php
-rw-r--r--  1    513     513   334 May 18  2012 wp-register.php
-rw-r--r--  1    513     513   224 Apr 21  2011 wp-rss.php
-rw-r--r--  1    513     513   226 Apr 21  2011 wp-rss2.php
-rw-r--r--  1 nobody nogroup 10880 Nov  4 16:24 wp-settings.php
-rw-r--r--  1 nobody nogroup 25665 Nov 12 19:23 wp-signup.php
-rw-r--r--  1 nobody nogroup  4026 Oct 24 15:58 wp-trackback.php
-rw-r--r--  1 nobody nogroup  3015 Oct 24 19:29 xmlrpc.php

So it seems that 513 and nobody own most of these files - Is that why none of the users I create using adduser are allowed to modify them? When I setup this web server, i followed the Linode Library tutorials and ran these 2 commands…

adduser friendaccount
usermod -a -G sudo friendaccount

I added friendaccount as an allowed user in /etc/ssh/sshd_config - I can successfully login to the server on the command line via SSH. But when I navigate to the directory - to test if it's working - and run "touch file1" I get errors.

touch: cannot touch `file1': Permission denied

My goal is to figure out how to add users so they can have their own sftp accounts and upload/download files. I've been doing everything as root for the past few years since I'm not entirely understanding the permissions.

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.