LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-20-2015, 12:37 PM   #1
xmrkite
Member
 
Registered: Oct 2006
Location: California, USA
Distribution: Mint 16, Lubuntu 14.04, Mythbuntu 14.04, Kubuntu 13.10, Xubuntu 10.04
Posts: 554

Rep: Reputation: 30
How do I grant myself super access to files/folders?


Here is an output example when I run ls -l

drwx------ 24 user1 user1 4096 Dec 7 21:00 folder1
drwxrwxrwx 6 user1 user1 4096 Apr 18 20:36 folder2


I am able to browse folder2 just fine but not folder1 unless I open my file manager with sudo.

Is there a way to somehow grant myself access to everything? It's my system and I want to view all files on the system. I should be able to get into folder1 without having to fire up the file manager using sudo.
 
Old 04-20-2015, 12:46 PM   #2
whm1974
Member
 
Registered: Apr 2015
Posts: 142

Rep: Reputation: 28
Quote:
Is there a way to somehow grant myself access to everything? It's my system and I want to view all files on the system. I should be able to get into folder1 without having to fire up the file manager using sudo.
Not a good ideal. There are good reasons why sudo is there and why you shouldn't be logged in as root all the time.
 
Old 04-20-2015, 01:03 PM   #3
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
Quote:
Here is an output example when I run ls -l

drwx------ 24 user1 user1 4096 Dec 7 21:00 folder1
drwxrwxrwx 6 user1 user1 4096 Apr 18 20:36 folder2


I am able to browse folder2 just fine but not folder1 unless I open my file manager with sudo.
Which user account are you using to access folder1? If it is user1 then I doubt you will have any trouble accessing folder1. However, if you are using any other account to access folder1 then it will get blocked because the permission is set to 700 which mean only owner has got full access, group and other have no access to it. That is the reason you have to use sudo to get into folder1.

You are able to get into folder2 without any issues because permissions on folder2 is set to 777 which means owner, group and others have got full access to folder2 and anyone can get in.

Quote:
Is there a way to somehow grant myself access to everything? It's my system and I want to view all files on the system. I should be able to get into folder1 without having to fire up the file manager using sudo.
It appears to me that folder1 and folder2 both are under user1 home directory. Granting other account access to it is not a good deal in real world scenarios. Usually when such requirements come we go with setting up sgid on a shared folder located outside users home directory.

As this is your test server or the server on which you are trying to do R&D you have got two options:

1. Setup ACL, which is kind of messy if you are trying to set it up on multiple directories. Basically troubleshooting file permission issues with ACL on will drive you crazy.

2. Give permission to others, I wouldn't suggest giving write permission but just allow browsing. You can do that by executing the following command:

Code:
sudo chmod -R 755 folder1
Running with -R so that any folders under folder1 will also get same permission recursively.
 
Old 04-20-2015, 01:11 PM   #4
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
You can give folder1 group permission rwx and make the filemanager user a member of that group.
 
Old 04-20-2015, 01:16 PM   #5
xmrkite
Member
 
Registered: Oct 2006
Location: California, USA
Distribution: Mint 16, Lubuntu 14.04, Mythbuntu 14.04, Kubuntu 13.10, Xubuntu 10.04
Posts: 554

Original Poster
Rep: Reputation: 30
The main thing I am actually just trying to do is to backup the folder using rsyinc over ssh to another system but I am getting permission denied messages. User1 is not me.

Sudo chmod -R 755 would work, but not if they keep adding folders here or there. I'd have to do that each and every time I run the backup. Can I run rsync over ssh but use sudo? Will that run sudo on the remote computer too or just locally?

ie... sudo rsync -azvr ssh user2@server:/media/files /home/user2/backup

Right now I run something like: rsync -azvr ssh user2@server:/media/files /home/user2/backup

But what happens from time to time is users ask me to take a look at their files for help here or there and it's a pain to pop up a sudo file manager, so I'm hoping to find a way around it.
 
  


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
Access rights on folders and files. Antriksh07 Linux - Security 3 05-02-2013 02:30 PM
LXer: How to access Microsoft Windows files and folders from Linux LXer Syndicated Linux News 0 01-03-2012 04:30 AM
[SOLVED] Apache2 | Can't access any files, folders or subdirectories HELP!!! Charles2k Linux - Software 14 12-01-2011 11:57 AM
Cannot understand to limit/enable certain group access to folders/files. JayQ7 Linux - Newbie 4 10-07-2008 06:46 PM
Samba can create new files and folders but access denied in any new folders k.king Linux - Networking 2 01-15-2006 06:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:58 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
Open Source Consulting | Domain Registration