Solved

Ubuntu / Linux Permissions Question

Posted on 2011-02-25
6
485 Views
Last Modified: 2012-05-11
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
0
Comment
Question by:wantabe2
6 Comments
 

Expert Comment

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

sudo -R chmod 777 /var/www

0
 
LVL 12

Accepted Solution

by:
upanwar earned 500 total points
ID: 34979101
You dont have the permission to write in /var/www, Because you are logged in by normal user not by root so first copy that file in your home directory and then copy that file from your home directory to /var/www by executing the below given command.

sudo cp /home/<your user name>/<file name> /var/www/.
0
 
LVL 35

Expert Comment

by:torimar
ID: 34979105
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.
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 16

Expert Comment

by:santoshmotwani
ID: 34979109
log onto ubuntu
go to terminal
type su
enter root password

chmod 0777 /var/www/



This will do the  job.
0
 
LVL 16

Expert Comment

by:santoshmotwani
ID: 34979113
chomod -R 0777 /var/www
0
 
LVL 35

Expert Comment

by:torimar
ID: 34979121
ps:

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

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now