LinuxQuestions.org
Visit Jeremy's Blog.
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 12-17-2013, 04:23 AM   #1
kelaskakap
Member
 
Registered: Dec 2013
Posts: 31

Rep: Reputation: Disabled
Wink Give write permission to user


Hello guys
How to give write access to user in folder /var/www ? .I'm using slackware and running apache webserver on my computer, when I list folder /var/www it's belong to apache.
Code:
agan@darkstar$ls -l /var/www

-rwxrwx---  1 apache apache 19941 2013-10-23 02:53 update.php
-rwxrwx---  1 apache apache  9642 2013-10-23 02:53 UPGRADE.txt
-rwxrwx---  1 apache apache  2051 2013-10-23 02:53 web.config
-rwxrwx---  1 apache apache   417 2013-10-23 02:55 xmlrpc.php
every time I want to create, update, delete file to folder /var/www , it's always failed, permission denied. I must change to root first if I want to do that. how to give write access to my user account (group = users) into folder /var/www so I don't need change to root ?

Thank you so much

Last edited by kelaskakap; 12-17-2013 at 04:24 AM.
 
Old 12-17-2013, 05:16 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Add Apache as a secondary group to your user acct http://www.cyberciti.biz/faq/howto-l...user-to-group/
 
Old 12-17-2013, 07:34 AM   #3
kelaskakap
Member
 
Registered: Dec 2013
Posts: 31

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by chrism01 View Post
Add Apache as a secondary group to your user acct http://www.cyberciti.biz/faq/howto-l...user-to-group/
here's I tried
Code:
# usermod -a -G apache agan
bash-4.2$ groups
users lp wheel floppy audio video cdrom apache plugdev power netdev scanner
bash-4.2$cd /var/www
bash-4.2$touch test.php
touch: cannot touch 'test.php': Permission denied
am I doing wrong? how is the right one?

Last edited by kelaskakap; 12-17-2013 at 07:35 AM. Reason: wrong
 
Old 12-17-2013, 09:18 AM   #4
Habitual
LQ Addict
 
Registered: Jan 2011
Location: Youngstown, Ohio
Distribution: LM17.1/Xfce4.11.8
Posts: 7,178
Blog Entries: 10

Rep: Reputation: 1980Reputation: 1980Reputation: 1980Reputation: 1980Reputation: 1980Reputation: 1980Reputation: 1980Reputation: 1980Reputation: 1980Reputation: 1980Reputation: 1980
Try opening a new shell|terminal and try touch again
 
Old 12-17-2013, 09:26 AM   #5
nd7rmn8
Member
 
Registered: Jan 2013
Distribution: Arch
Posts: 50

Rep: Reputation: 13
whats the permission as well as owner and group of /var/www ?

without write permissions to the parent directory, you can't create new files within that directory.
 
Old 12-17-2013, 09:31 AM   #6
GNU/Linux
Member
 
Registered: Sep 2012
Distribution: Slackware-14
Posts: 118

Rep: Reputation: Disabled
Try logging out and log back in.

Edit: Even then you can't touch then change your username to 'mchammer' .

Last edited by GNU/Linux; 12-17-2013 at 09:39 AM.
 
Old 12-17-2013, 09:36 AM   #7
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,130
Blog Entries: 2

Rep: Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825
Whenever you modify your user, for example with adding him to a group, you have to log out and back in for the changes to work.
 
Old 12-17-2013, 09:39 AM   #8
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 2,324
Blog Entries: 1

Rep: Reputation: 447Reputation: 447Reputation: 447Reputation: 447Reputation: 447
When you modify your group list it doesn't apply until you login (again). Log out and log in or just su to yourself. There could also be some selinux access control in play depending on the system.
 
Old 12-17-2013, 10:11 AM   #9
kelaskakap
Member
 
Registered: Dec 2013
Posts: 31

Original Poster
Rep: Reputation: Disabled
ok done, thanks guys
 
Old 12-17-2013, 11:06 AM   #10
GNU/Linux
Member
 
Registered: Sep 2012
Distribution: Slackware-14
Posts: 118

Rep: Reputation: Disabled
Might as well marked it as Solved.
 
  


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
Help with user permission level--give access to a user 2 use 500 servers svani Linux - Newbie 2 06-17-2010 09:57 PM
Slackware 12.0 based distros are refusing to give me permission to write Rettic AC Slackware - Installation 2 08-14-2007 02:02 AM
External Hard Drive does not give me the permission to write erockallstar Linux - Newbie 22 01-29-2007 04:40 PM
Mounted a filesystem as root.How does one give write-permission to a user? Mr.DeVillie Linux - Software 4 02-08-2006 08:20 AM
how to give ordinary users write permission to fat32 LeftyAce Debian 3 01-15-2006 04:03 PM


All times are GMT -5. The time now is 11:03 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