LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 11-04-2008, 01:20 PM   #1
dolceinter1
LQ Newbie
 
Registered: Nov 2008
Posts: 9

Rep: Reputation: Disabled
give a user selective privilege using sudo


I'm the root I'm trying to give user Mike only ftp server rights using sudo.

Please help!!!
 
Old 11-04-2008, 02:05 PM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Could you explain what you mean by ftp server rights. Ftp should be a service running as a system user.

You also shouldn't be logging in as root. So the first part of your statement sounds bad as well.

By convention, usernames should be all lowercase. Some programs and services don't behave properly if they aren't.

You could have an entry to allow user 'mike' or a group mike belongs to to use rvim or rgvim to edit the config file for the service. Be sure to include the full pathname to the command. These two commands don't allow running a shell or suspending the editor to the background. This is to prevent the user from running a root shell.

See the comments in /etc/sudoers. It includes an example allowing users to mount a cdrom disc. Also, use visudo to edit the sudoers file.

Last edited by jschiwal; 11-04-2008 at 02:10 PM.
 
Old 11-04-2008, 02:26 PM   #3
dolceinter1
LQ Newbie
 
Registered: Nov 2008
Posts: 9

Original Poster
Rep: Reputation: Disabled
what I mean is I'd like mike to only be able to use ftp server when using sudo. I just want to give him selective privilege.
For example to give Mike full right i'd do:

Mike ALL=(ALL) NOPASSWD: ALL


Now, how about only ftp server privileges?
 
Old 11-04-2008, 06:52 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
As per jschiwal, what you're asking doesn't make sense.
The ftp server runs as its own user, you don't give 'server rights' to anyone (else), it doesn't make sense.
If you want him to be able to use ftp ie send/get files, that's being a client user and has nothing to do with the server end.
You just type ftp at the cmd line and follow the prompts.
If you mean you only want him to be able to send/get files if he goes via sudo, that's unusual, in fact unique. All the security is handled by the server anyway, you shouldn't need to do that.
 
Old 11-06-2008, 03:18 AM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
If this user is a local user and you only want that user to be able to log into the machine remotely using ftp, then check the documentationn for the ftp server you are using. vsftp has a file that contains a list of users who cannot log in. You could add the other users to this list.

A user running ftp as root doesn't make sense and I'm getting a bit tired of questions dealing with doling out root privileges like candy, usually because of laziness in having to type in a password. That's the reason that Windows is so insecure. Always follow the principle of least priviledges. I hope we don't get a bunch of Vista users simply because they don't like entering in the administrators password to install software, and end up with a lot of insecure Linux machines on the net.
 
Old 11-09-2008, 01:27 PM   #6
n03x3c
Member
 
Registered: Aug 2008
Location: India
Distribution: Fedora, RedHat
Posts: 101

Rep: Reputation: 17
A possible solution can be like this.

Make one script that include cmds that you need to grant userX. Write script in way that userX get choice to run cmd he/she would like to run. Put script in /some/where/safe/ where only root has access perms. Turn script's SGID bit on and remove exec perms for others (and group if you wanna) and then add sudo entry like this...

Code:
userX    ALL=/path/to/script.sh
 
  


Reply

Tags
linux, sudo



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 give a user only ftp server privilege using sudo? dolceinter1 Linux - Newbie 1 11-05-2008 07:56 AM
Super user privilege pvpnguyen Linux - Security 4 02-01-2008 10:35 AM
Maximum User Privilege Crito General 4 08-09-2006 09:11 AM
User privilege to partition atlaika Ubuntu 3 04-03-2006 01:44 PM
Ulimit privilege for a user linuxfans Linux - General 3 04-16-2003 12:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

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