0

On my Media Temple DV 4.0 server I am getting permission denied errors:

-bash: cd: httpdocs: Permission denied

If I switch from my login user to sudo (sudo su) or switch to root using su-, I can access the directory with any issue. This is just my site's files directory though so not sure why I'm being denied.

Additionally, I added my user to the visudo commands file with:

user ALL=(ALL) ALL

Any suggestions to what else could be the issue?

JM4
  • 1,144
  • 3
  • 18
  • 29

1 Answers1

0

Check the permissions on the directory and change them if necessary.

mdpc
  • 11,856
  • 28
  • 53
  • 67
  • by MT - and Plesk standards, all directories created are owned by the FTP user. with drwxr-xr-x permissions. This is standard - surprising it would need any alternative. In either case, why can't a user with sudo priviledges = ALL be able to access it? – JM4 Dec 03 '12 at 22:15
  • 1
    sudo only allows a user to become root and bypass permissions, it does NOTHING in terms of allowing a normal user to bypass permissions. – mdpc Dec 03 '12 at 22:19
  • perhaps I misunderstood but what is the point of giving a user ALL privileges in the sudoers file then? – JM4 Dec 03 '12 at 22:23
  • 1
    so you do not have to login directly as the root user. A log entry is made of which user upped their permissions to root and if used properly the command that was executed. I'd read the sudo man page. – mdpc Dec 03 '12 at 22:26
  • I'm not sure I follow or see the sense in your statement. The point of creating a user to prevent root login does not necessarily have anything to do with applying "ALL" privileges to a user. They are two separate issues altogether. Changing the permissions on the directory itself *should* have nothing to do with the access a user is given within the system. If "becoming root" is the only method then somebody can come out and say that although I doubt that is the case. There is somewhere else changing USERS privileges would allow him to modify and access specific directories – JM4 Dec 03 '12 at 23:01
  • I do, however, understand your point about logging the issues. The only *real* reason I cared to access the directory in the first place to was to run a composer update. For some reason, ROOT cannot access the /usr/local/bin global commands unless explicityly stated. – JM4 Dec 03 '12 at 23:02
  • 1
    @JM4 you appear to have a fundamental misunderstanding of what `sudo` does. It ***DOES NOT*** "apply privileges to a user". It is a program which allows users to run commands under another UID (usually root, UID 0). The entries in the `sudoers` file specify what programs may be run *using the `sudo` command*, and the conditions under which they may be run. The problem you are reporting in your question, as mdpc correctly pointed out, is the result of [directory permissions](http://en.wikipedia.org/wiki/Filesystem_permissions#Traditional_Unix_permissions) being set incorrectly. – voretaq7 Dec 04 '12 at 00:11
  • @voretaq7 - Thank you for your clarification. Curious though, why can a root user access/modify/etc anything on the system but apparently any other user cannot? Is there another way to give a user this capability because redefining the privileges on the exact folder mentioned is not an option. – JM4 Dec 04 '12 at 19:34
  • not unless the user is the root user (i.e. UID #0). If you cannot change perms on the folder (or even add ACLs if support), then you are out of alternatives. – mdpc Dec 04 '12 at 19:39