Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 05-21-2013, 01:08 PM   #1
LQ Newbie
Registered: May 2013
Posts: 6

Rep: Reputation: Disabled
ssh account to restart 1 service ?


I created account on my linux machine for one of my clients, and allowed him to restart red5 service

i did that using visudo by adding
username ALL = /etc/init.d/red5

but when he makes ls /var/ or any other dir, he is allowed to see the content of /var.

The question is how to restrict him from going outside his homedir and still can restart red5 service

Thank you
Old 05-21-2013, 01:25 PM   #2
LQ Newbie
Registered: May 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
One more thing could help me.

I need to know how to make this user once he logged in the ssh execute automatically /etc/init.d/red5 restart and then foce him to logout from ssh.

which means that everytime he needs to restart red5 which is my main point, he just login to Terminal then write his username and password and thats it .

this is to make him not able to run other commands except restarting his red5 service any time he needs.

But how could i finish that !

Last edited by elkhedewy; 05-21-2013 at 01:28 PM.
Old 05-21-2013, 02:24 PM   #3
LQ Newbie
Registered: May 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled

i finished that by the following,

First created account

Then added this line at /etc/sudoers
username ALL = /etc/init.d/"service name"

ln -s /bin/bash /bin/rbash

vim /etc/passwd




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
[SOLVED] SSH - How can I only allow a key pair login for my user account not root account? shanekelly Linux - Security 5 01-25-2013 09:45 AM
Cron service and oracle service stopped unexpectedly. Can't restart oracle. camron Linux - Newbie 6 06-10-2010 06:00 PM
ssh local account / ldap account Poil Linux - Security 5 02-26-2010 01:04 AM
How do I set the regulatory daemon to restart when I restart the network service? zahadumy Linux - Networking 0 11-05-2006 11:24 AM
Can't SSH until restart service Da Puff Mandriva 4 09-14-2005 08:51 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:14 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration