LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 09-21-2013, 10:26 PM   #1
casperdaghost
Member
 
Registered: Aug 2009
Posts: 349

Rep: Reputation: 16
accessing files with sudo


yeah every time i have to add to this directory
and then i cant because i have to use sudo.



Code:
ubuntu@ubuntu-VirtualBox:/usr/lib/cgi-bin$ sudo cat > here_we.cgi
-bash: here_we.cgi: Permission denied
ubuntu@ubuntu-VirtualBox:/usr/lib/cgi-bin$
what are my options here -
besides changing the permissions of the directory.

can i link it to another directory that has local user
rights.
 
Old 09-21-2013, 11:30 PM   #2
casperdaghost
Member
 
Registered: Aug 2009
Posts: 349

Original Poster
Rep: Reputation: 16
What are my options here?
If i change the ownership of the directroy, will that screw up apache?
Code:
ubuntu@ubuntu-VirtualBox:/usr/lib/cgi-bin$ ls -ltr /usr/lib/ | grep cgi-bin
drwxr-xr-x  2 root root         4096 Sep 20 23:39 cgi-bin
ubuntu@ubuntu-VirtualBox:/usr/lib/cgi-bin$
 
Old 09-21-2013, 11:39 PM   #3
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,464

Rep: Reputation: Disabled
Quote:
and then i cant because i have to use sudo.
Can you explain what this means? Do you mean if you use sudo (assuming sudo is set up ok) it does work? or it doesn't work? Your example in the first post seems to show that it doesn't work even if you use sudo. Please explain what's going on more clearly.

Does the code in your second post show the original folder permissions or the permissions you changed it to.

Quote:
If i change the ownership of the directroy, will that screw up apache?
On way to find out is to do it. I guess you can always change the permissions back if it screws things up.

jdk
 
Old 09-22-2013, 12:07 AM   #4
casperdaghost
Member
 
Registered: Aug 2009
Posts: 349

Original Poster
Rep: Reputation: 16
everytime I want to make a change to a file in that directory, i have to use sudo.
I am too lazy to use sudo each time I want to change a file in that directory.

should I change the file permissions of that directory -
how do i change file permissions?

what do i have to change the directory to in order to get the locat user to be able to change files in this directory.
becauyse right now the ony way to change files in this directory is to use sudo - that is it
if I do not use sudo, i cannot write to that directory.
 
Old 09-22-2013, 02:52 AM   #5
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,464

Rep: Reputation: Disabled
There are very good reasons for this policy. Learn to live with it or suffer the consequences. You have been warned.
jdk
 
Old 09-22-2013, 03:44 PM   #6
odiseo77
Senior Member
 
Registered: Dec 2004
Location: Caracas, Venezuela
Distribution: Debian Sid, OpenSUSE 42.2
Posts: 1,191

Rep: Reputation: 631Reputation: 631Reputation: 631Reputation: 631Reputation: 631Reputation: 631
Simply type sudo -s to log into a root terminal, do all the changes you need to do, and then type exit to log out from the root terminal.
 
  


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
LXer: The Ultimate Sudo FAQ To Sudo Or Not To Sudo? LXer Syndicated Linux News 13 04-13-2013 01:36 AM
Accessing users home directory with sudo access..How to block this ? sujithspillai90 Linux - Newbie 1 04-20-2012 07:25 AM
Accessing Sudo Firefox for not yet-registered password? imcomp_tech88 Linux - Newbie 1 01-31-2008 11:03 PM
accessing of directory using sudo users abhis_mail2002 Fedora 3 02-22-2006 03:34 AM
sudo: How can i change the ownership of particular files? anoopp Linux - Security 1 03-18-2005 02:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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