LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 03-08-2010, 11:33 AM   #1
stdcinout
LQ Newbie
 
Registered: Mar 2010
Posts: 7

Rep: Reputation: 1
software to access file system.. how to allow access for non root users?


hi guys i know linux is designed that non root users cant have access to certain folder in file system

my easy way to access is temporarily login as root ( or nautilus open as root )

but then if IDE like eclipse trying to write data to restricted folder in file system it wont allow

is there any way to include my user account as root forever?

i know it is not safe for security purpose but it is not very convenient for me to have this kind of restriction.
 
Old 03-08-2010, 11:39 AM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Which directories do you need eclipse to write to, and why?

The "proper" way of doing this if you for example were using eclipse
for some web-related task to make /var/www/htdocs/yoursite owned by
a group that you're a member of, and chmod it to be group writable,
not to make you root on a permanent basis.


Cheers,
Tink
 
Old 03-08-2010, 11:42 AM   #3
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
You are looking at the problem through the wrong lenses. I'll answer nonetheless.

Quote:
Originally Posted by stdcinout View Post
hi guys i know linux is designed that non root users cant have access to certain folder in file system
Read on chmod and chown to set the permissions and the owner:group for a given file. They both can use -R for recursive operation. Be aware that directories need +x to allow access. Be also aware that massively changing permissions and/or ownership of system files and directories can (and eventually WILL) break your installation, to the point of rendering it unusable, requiring a re-installation to fix it.

Quote:
my easy way to access is temporarily login as root ( or nautilus open as root )
As it's meant to be.

Quote:
but then if IDE like eclipse trying to write data to restricted folder in file system it wont allow
If you are using Eclipse that way you are really doing it the wrong way. There's no reason to use such a program as root. At all.

Quote:
is there any way to include my user account as root forever?
Use root all the time? "At your own risk (TM)".

Quote:
i know it is not safe for security purpose but it is not very convenient for me to have this kind of restriction.
Why? As I said above, I think you are just looking at the problem from the wrong angle. I am pretty sure there's a proper solution to your "problem" that doesn't require such hackish stuff. If you truly want that, I'd choose another OS. It will be far less traumatic.
 
Old 03-08-2010, 11:45 AM   #4
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 167Reputation: 167
Change ownership to your user, run the application as root (or gnome/kde sudo), change permissions to less restrictive, add yourself to the group of the directory/files.
Code:
chown -R username:group /path/for/user
or
Code:
find /path/for/user -type d -exec chmod 777 {} \; && find /path/for/user -type f -exec chmod 666 {} \;
or
Code:
groupadd -G group username
There are a lot of ways to accomplish what you want to do, it just depends on what your criteria are for the specific task.

It would also depend on what you mean by "linux is designed that non root users cant have access to certain folder in file system", which is pretty much untrue. The default permissions are not the permanent permissions and almost all permissions can be changed with very few exceptions.

Although a bad idea you could change your users id to roots and then you and root are the same effective user... but this is a 'bad plan(tm)'. You could also just login and run as root, but again, this is a bad plan.

It would help tremendously to have considerably more details.

Last edited by rweaver; 03-08-2010 at 11:46 AM.
 
Old 03-08-2010, 12:08 PM   #5
stdcinout
LQ Newbie
 
Registered: Mar 2010
Posts: 7

Original Poster
Rep: Reputation: 1
yah thanks guys i understand what you mean i guess i would have to digg in more with chmod groups and users thing...i was just trying to set up eclipse with php running on lampp ( xampp linux ) on /opt/lampp/ but found that eclipse wasn't able to write files to htdocs. i did it eventually . but um i need to study more about chmod operations as i don't remember them and barely use them

thanks
 
Old 03-08-2010, 12:37 PM   #6
jamescondron
Member
 
Registered: Jul 2007
Location: Scunthorpe, UK
Distribution: Ubuntu 8.10; Gentoo; Debian Lenny
Posts: 961

Rep: Reputation: 70
Man pages are all you need really, no need to memorise or study, just look it up on the fly
 
Old 03-08-2010, 01:15 PM   #7
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 167Reputation: 167
The short short chmod primer is -

chmod flags group+perm or chmod flags group-perm.

group where..
u - owner
g - group
o - everyone else
a - all 3 above

permission where...
r - read
w - write
x - execute

flags where...
-R - recursive

In reality you probably want to chown it to the webserver user and add yourself to that group.
 
Old 03-08-2010, 05:04 PM   #8
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Quote:
Originally Posted by stdcinout View Post
yah thanks guys i understand what you mean i guess i would have to digg in more with chmod groups and users thing...i was just trying to set up eclipse with php running on lampp ( xampp linux ) on /opt/lampp/ but found that eclipse wasn't able to write files to htdocs. i did it eventually . but um i need to study more about chmod operations as i don't remember them and barely use them

thanks

When dealing with permissions you always have to set the absolute minimum that you'll need to operate. You certainly don't need god-like powers (root) to do this. Not at all.

You can set separate read, write and exec permissions for the owner, the group and "the rest". All you need to do is to assign htdocs and everything under to a given group, then add yourself to that group. Give the files +r and +w for the group, for dirs you will also need to enable +x.

Using complex GUIs like eclipse as root is a recipe for disaster.
 
1 members found this post helpful.
Old 03-09-2010, 12:55 PM   #9
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 167Reputation: 167
I agree, a simple slip up or bad interaction between you and gui could cause catastrophic damage to the system if its running as root. There are a ton of solutions far better than that one.
 
  


Reply



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
How to gain Write-Access to a File System as Root tobiasw Linux - General 3 02-02-2011 08:02 AM
Help with Apache: free access from lan users and password access to wan users... how? maginotjr Linux - Server 4 01-01-2011 11:08 AM
SSH access problems: Can only allow users SSH access by adding to root group dhupke Slackware 10 12-21-2008 09:48 AM
different users can all access file system and copy/paste? mhg Linux - Newbie 3 10-28-2008 09:40 PM
users with root access? ginda Linux - Security 1 08-20-2007 06:01 AM

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

All times are GMT -5. The time now is 06:59 PM.

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
Open Source Consulting | Domain Registration