LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 04-10-2013, 03:38 PM   #1
BCC
LQ Newbie
 
Registered: Apr 2013
Posts: 2

Rep: Reputation: Disabled
Question Grant read-only access to users using visudo?


I would like to grant read only access to all files for one user on a Linux server (CentOS 6.3). VISUDO is what looked promissing, but after a couple hours of searching it has yielded no results other than to be able to grant full access. Does anybody know if this can be done? Thank you.
 
Old 04-10-2013, 04:10 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by BCC View Post
I would like to grant read only access to all files for one user on a Linux server (CentOS 6.3). VISUDO is what looked promissing, but after a couple hours of searching it has yielded no results other than to be able to grant full access. Does anybody know if this can be done? Thank you.
Well, visudo is one command, that is used to set up the sudoers file. That command only does that ONE thing, so I'm not sure why you thought it would do anything related to file permissions.

That said, *MOST* of the files on your system are probably readable to a 'regular' user anyway, with the exception of a very few. If all you want the user to be able to do is look at the contents of files, then grant them root access to the 'cat' command only, in the sudoers file, like this:
Code:
usersname ALL=/usr/bin/cat
That should let them look at any file on the system, but not change anything. However, if you don't trust this user to make changes, you should not trust them with being able to read all the files, or escalated privileges AT ALL.
 
1 members found this post helpful.
Old 04-10-2013, 04:26 PM   #3
BCC
LQ Newbie
 
Registered: Apr 2013
Posts: 2

Original Poster
Rep: Reputation: Disabled
Smile

Quote:
Originally Posted by TB0ne View Post
Well, visudo is one command, that is used to set up the sudoers file. That command only does that ONE thing, so I'm not sure why you thought it would do anything related to file permissions.

That said, *MOST* of the files on your system are probably readable to a 'regular' user anyway, with the exception of a very few. If all you want the user to be able to do is look at the contents of files, then grant them root access to the 'cat' command only, in the sudoers file, like this:
Code:
usersname ALL=/usr/bin/cat
That should let them look at any file on the system, but not change anything. However, if you don't trust this user to make changes, you should not trust them with being able to read all the files, or escalated privileges AT ALL.
Thank you very much. I fully understand and appreciate your expressed concern about exentding privileges in this way. It is temporary.
 
Old 04-10-2013, 04:30 PM   #4
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
It also lets them destroy your system.

You have to disable exec.
 
  


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
[SOLVED] can not grant access to mysql for remote users golden_boy615 Linux - General 7 06-01-2011 12:00 AM
[SOLVED] Centos grant read access for rSync vzxen Linux - Newbie 8 05-04-2011 11:11 PM
Grant Apache read access to a file? damgar Linux - Server 1 09-22-2010 11:13 AM
Grant certain group read-only access to /var directory loadedmind Fedora 5 06-14-2010 10:16 AM
grant telnet/ssl access to oly some users plisken Linux - General 3 02-21-2004 01:41 PM

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

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