Link to home
Start Free TrialLog in
Avatar of wantabe2
wantabe2Flag for United States of America

asked on

Ubuntu / Linux Permissions Question

I'm using Ubuntu 10. I'm using WinSCP to copy files from my Windows computer to the Ubuntu box. When I copy files over I get the attached error. I can copy to my home directory fine but when I try to copy to the /var/www directory I get the error. I am logged in with the user account I set up when I installed Ubuntu yesterday. I'm new to this so I'm hoping this is an easy fix. Thanks
ubtun.JPG
Avatar of matstherkelsen
matstherkelsen

Your user has no access in the /var/www folder. The following command should fix it:

sudo -R chmod 777 /var/www

ASKER CERTIFIED SOLUTION
Avatar of upanwar
upanwar
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This is the permission's issue that always makes me wonder why people even bother to use Ubuntu as a server OS. Simply use Debian (the mother of Ubuntu) and everything will work fine.

In detail:
Ubuntu has practically abolished the root user which is required for practically every movement you do in server administration. It is still there, but you cannot use it to login.
All files outside of your user's home dir belong to this unobtainable root account.

On an Ubuntu desktop, this is easily dealt with by using the "sudo" command in front of all administrative commands. When conneting to your server via SSH, you can open a root terminal via the command "sudo -i".

But here, in WinSCP, the full drawback of the Ubuntu server becomes obvious.
You need to elevate your privileges to root, but how? Unfortunately, that is a question I cannot answer because I use Debian, never Ubuntu when it comes to servers. There may be a workaround, and somebody here may know it.
Otherwise, simply consider switching to Debian.
log onto ubuntu
go to terminal
type su
enter root password

chmod 0777 /var/www/



This will do the  job.
chomod -R 0777 /var/www
ps:

I wouldn't suggest you use another server OS if you didn't say yourself that you only installed Ubuntu yesterday.