software to access file system.. how to allow access for non root users?
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
You are looking at the problem through the wrong lenses. I'll answer nonetheless.
Quote:
Originally Posted by stdcinout
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.
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.
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
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.