LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-16-2006, 06:18 PM   #1
DarkD45
LQ Newbie
 
Registered: Dec 2004
Distribution: Arch
Posts: 14

Rep: Reputation: 0
SHH Users and Root Commands


I dont know if this really is the right forum to post in but i really would like to know if anyone knows how to help me out here.

So, We are working on some php stuff and need to be able to give an SSH account acsess to the SSH Service command, we dont want to directly conncect root because -su does not work in the php ssh2() module. If that makes sense...

Well if anyone knows how to do this, or another way to do this, it would be greatly apreciated.

(Sorry if i posted in the wrong forum.)

- DarkD45
 
Old 02-17-2006, 11:33 AM   #2
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
I'm not exactly sure what you mean by "SSH Service command". Could you give an explanation of what it is you want to do? It is possible that sudo could work, but I know I need a touch better idea of what you want to accomplish before I would know.
 
Old 02-17-2006, 06:08 PM   #3
DarkD45
LQ Newbie
 
Registered: Dec 2004
Distribution: Arch
Posts: 14

Original Poster
Rep: Reputation: 0
well, we are using ssh2 (search ssh2 on php.net if you dont know what it is) it makes a connection to SSH in php. we use Red Hat Enterprise 3, what we want to do is be able to login as a normal SSH user (in this case the user "staff") and we want to give them permission to some root commands, such as the service command (like: service bind stop; service bind start)

hope that explains it.
 
Old 02-18-2006, 07:13 AM   #4
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
Thanks, that clears things up. I do think you want to use sudo in this case. Essentially you would be giving the user staff permission to run certain commands with root privileges on the RHE box. So instead of su ing to root, staff would issue the command sudo service bind stop and then service bind stop would be run as root. The trick is to set up your sudoers file so that the user staff does not have to enter a password in order to use sudo. You can modify your sudoers file with the visudocommand, but be aware that it uses the vi editor, which can be mroe than a little painful if you're not familiar with it. You do want to use the visudo command however as it checks for syntax errors when you exit. That can save a LOT of frustration.
 
Old 02-18-2006, 07:37 PM   #5
DarkD45
LQ Newbie
 
Registered: Dec 2004
Distribution: Arch
Posts: 14

Original Poster
Rep: Reputation: 0
thanks, i'll try that.

edit: ok so it works, but is there a way to allow staff to be able to have permission to execute files in the /etc/init.d/ directory? becasue thats all thats left and then it will work.

Last edited by DarkD45; 02-18-2006 at 09:21 PM.
 
Old 02-19-2006, 01:40 AM   #6
imemyself
Member
 
Registered: Feb 2004
Location: Wichita, KS
Distribution: CentOS 4, SuSE 10, Tiger
Posts: 110

Rep: Reputation: 15
I don't know if it would work, but have you tried putting /etc/init.d/* in visudo. So something like
Code:
<user | %group> ALL=/etc/init.d/*  NOPASSWD: ALL
Or mayne try just putting /etc/init.d/ in without the * if it doesn't work with the *
 
Old 02-19-2006, 07:59 AM   #7
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
I guess it really comes down to how much system-wide access do you want to allow this user to have. You could put the needed /etc/init.d files into sudoers and use sudo. An alternatve would be to put the staff user into the group that owns the /etc/init.d files and make sure that those files can be executed by that group. However, that may also allow staff to run other commands. Yet another alternative would be to change the group ownership of /etc/init.d to something new, like staffgroup. If you use chown to have the ownership root:staffgroup then root could still execute at boot time, and anyone in staffgroup could also execute.
 
  


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
Root/User rights to Root commands? mrde50garfield Linux - Software 2 10-24-2006 05:42 AM
commands to Add Users bickyz Linux - Networking 2 11-12-2004 09:13 AM
Giving regular users access to certain root-only commands slickrcbd Linux - Newbie 4 12-24-2003 07:27 AM
Using 'r' commands as root users lapthorn Linux - Networking 2 11-24-2003 08:03 AM
Allowing Users commands Atroxic Linux - Newbie 2 02-01-2002 11:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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