LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-03-2014, 02:00 PM   #1
olarsson
LQ Newbie
 
Registered: Jan 2014
Posts: 3

Rep: Reputation: Disabled
Transfering files to Ubuntu LAMP


I am a newbee at Linux. To learn more Linux I have installed an Ubuntu headless server with LAMP on a VM virtualbox.
I would like to transfer files to the www map on LAMP, to do this I have connected to the Ubuntu server with sftp
and the same username and password that I used when installing the Ubuntu server.

I have found the www map, but I can not transfer files to it, (so that I for example can replace the default index.html file).
I get the error message write: permission denied from my sftp program. Presumably I dont have the right write permissions to the folder.

Write permissions to the folder are drwxr_xr_x. "User" can both read and write. How could I not have the right permissions?
If I am not "user" who is "user"? How could it be that I am not permitted to write to the folder. What should I do to be able to transfer files to the www folder?

Thank you for any help
 
Old 01-03-2014, 04:12 PM   #2
peonuser
Member
 
Registered: Mar 2008
Location: Where ever I am.
Distribution: Various
Posts: 177
Blog Entries: 166

Rep: Reputation: 21
Change to the web directory.
sudo scp -r yourusername@hostname:/wherefilesareonhost/filenames* .

You will have to type in the sudo password and the password on the host to log in.
 
Old 01-03-2014, 11:06 PM   #3
olarsson
LQ Newbie
 
Registered: Jan 2014
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by peonuser
Change to the web directory.
sudo scp -r yourusername@hostname:/wherefilesareonhost/filenames* .

You will have to type in the sudo password and the password on the host to log in.
Do you suggest that I should use SSH? Why does it not work the way I am doing it with sftp?
 
Old 01-04-2014, 12:23 PM   #4
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,051

Rep: Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852
The user you are using doesn't have privilege to change anything on the httpd server.
You need to act as root to be able to make those changes (sudo).
 
Old 01-04-2014, 04:28 PM   #5
docbop
LQ Newbie
 
Registered: Sep 2009
Location: Woodshed, CA
Distribution: Debian
Posts: 11

Rep: Reputation: 0
Well according to the permissions you posted, drwxr_xr_x. only the directory owner has write permissions. You didn't show the part with name of owner or group. So have to assume you aren't the own. In typical install the starting permissions are usually set to root. So you need to check who has permissions as well as the permissions themselves.
 
Old 01-06-2014, 01:37 AM   #6
olarsson
LQ Newbie
 
Registered: Jan 2014
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by docbop
Well according to the permissions you posted, drwxr_xr_x. only the directory owner has write permissions. You didn't show the part with name of owner or group. So have to assume you aren't the own. In typical install the starting permissions are usually set to root. So you need to check who has permissions as well as the permissions themselves.
Root owns of the www folder yes. I have learnt a little about the root account from here:

https://help.ubuntu.com/community/RootSudo

In Ubuntu root account is disabled to begin with. You have to enable it specifically to use it. Enabling root i generally not recommended because of security and stability of the system. It is instead recommended to use sudo command to get some of the
capabilities of root account.

It looks to me that enabling root is not the normal thing to do so what do you recommend me to do? Can I transfer ownership of
the map www, owned by root, from root to myself without self being root? Or do I have to enable root account for something as
simple as transferring a few files to the www folder? Can I use sftp to transfer the files?

I wonder one thing more: What type of account do I have when I log in with the user name and password that I installed with?
Obviously I am not root so what am? User with administrative rights?
 
Old 01-06-2014, 01:46 AM   #7
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Hi,

the simplest way would be to make /var/www writeable by your default user. One way to do this would be to make /var/www/ group writeable and put your user in that group. Eg assuming www-data exists, something like:
Code:
ssh defaultuser@server
sudo chown root:www-data /var/www
sudo chmod g+w /var/www
sudo usermod -Ga www-data defaultuser
Other options would depend on exactly what you want to copy to /var/www. Eg just one file or directory? Many files?

Evo2.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
transfering files to my pc Garrett85 Linux - Networking 2 02-13-2011 02:11 PM
How can I edit files remotely from LAMP Ubuntu Server with Ubuntu Desktop? pyrospade Linux - Server 4 11-27-2010 04:07 AM
Need help transfering my windows vista files to ubuntu 9.04 cman26 Linux - Newbie 4 05-30-2009 10:13 PM
Transfering Files webwally Linux - Networking 2 04-20-2005 06:17 AM
Transfering my files unixfreak Linux - Newbie 1 08-11-2004 10:53 PM


All times are GMT -5. The time now is 11:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration