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 05-04-2012, 04:55 AM   #1
amar.sree
LQ Newbie
 
Registered: Feb 2012
Location: india
Distribution: Redhat
Posts: 18

Rep: Reputation: Disabled
can i add user such he can only execute process


hi all,


can u all pls help me to create a user and that he can only execute HTTP process only...........


thanks in advance
Amar
 
Old 05-04-2012, 11:22 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by amar.sree View Post
create a user and that he can only execute HTTP process only.
What exactly do you mean? Should this unprivileged user start the HTTP process (meaning: run a web server)? Or do you mean this unprivileged user should be able to only access (remote) hosts via HTTP? Or what else? Please explain and be verbose.
 
Old 05-04-2012, 03:49 PM   #3
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
If you are looking to set up the user to be able to login via ssh and start,stop,restart apache you would simply add them as a regular user and set up sudo permissions for that user to those commands. You would simply run the 'visudo' command to edit your sudoers file and add this to the bottom:

Code:
username       ALL=(ALL)       NOPASSWD: /etc/init.d/httpd
 
1 members found this post helpful.
Old 05-04-2012, 08:25 PM   #4
amar.sree
LQ Newbie
 
Registered: Feb 2012
Location: india
Distribution: Redhat
Posts: 18

Original Poster
Rep: Reputation: Disabled
thank u all for replies..........

I had this question from interviewer...he asked me to add an user and that he should only execute httpd process(.,ie start,restart,reload,stop,)..?


IS it possible if he was given with nologin shell ? .if he was given with no login shell from where he can execute process

thnx & rgds
Amar
 
Old 05-07-2012, 10:52 AM   #5
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
Would not be possible with a nologin shell.
 
Old 05-07-2012, 11:16 AM   #6
em31amit
Member
 
Registered: Apr 2012
Location: /root
Distribution: Ubuntu, Redhat, Fedora, CentOS
Posts: 190

Rep: Reputation: 55
change shell to customized shell script can work in this case. create a script which have these option to start and stop and just change the user shell to this script. once user logged into the system that shell script will execute which have only predefined options to start/stop/reload and exit.
 
  


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] How can I get crontab to execute process every 10 minutes? keevill Linux - Newbie 4 01-31-2011 08:56 PM
Give permission to execute process as super user... chamila1986 Linux - Newbie 2 07-27-2010 06:03 AM
Is there a way to add an inetd-forked process to be executed in an user project? crisostomo_enrico Solaris / OpenSolaris 1 12-17-2008 09:45 PM
Failed to execute child process? une Linux - Newbie 2 09-20-2006 09:36 PM
problem with binding process and than execute another process chapa Programming 0 08-27-2003 03:47 AM

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

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