LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 01-15-2011, 05:51 PM   #1
mrmnemo
Member
 
Registered: Aug 2009
Distribution: linux
Posts: 527

Rep: Reputation: 51
Adding Privoxy user for source build


Hi,

Wanted to know how to add a user for Privox. Aside from the obvious stuff like not having a shell. For example, in the shadow file I wish to make sure that the account not only has no shell, but no login capability. I am thinking /bin/false would do this; however, I need to make sure.

Thanks
 
Old 01-15-2011, 07:30 PM   #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
Add a user like you would any other unprivileged one (with home = /etc/privoxy). /bin/false should do, mine has /sbin/nologin.
 
1 members found this post helpful.
Old 01-15-2011, 10:27 PM   #3
mrmnemo
Member
 
Registered: Aug 2009
Distribution: linux
Posts: 527

Original Poster
Rep: Reputation: 51
ok,
I actually wanted to see the account as a system account. Something like what you see in /etc/shado
Code:
news:*:14889:0:99999:7:::
NOte: From reading around a bit I guess the astix / exclamation point shows that the account can not "log-In".

So, I tried to user add with the following flags set as based on the man pages.
]CODE]useradd -D -M -U -s /bin/false Privoxy[/CODE]
The above would not work at all. All I wish do is create a user with no /home, shell, or privlage to log-in to the machine. I guess this would be a system account. However, I guess I have the options wrong. Could you help please?

Thanks.
 
Old 01-16-2011, 02:40 AM   #4
mrmnemo
Member
 
Registered: Aug 2009
Distribution: linux
Posts: 527

Original Poster
Rep: Reputation: 51
Hi again,

Just thought I would post this for anyone else that runs into this. I was able to get the privoxy user set up correctly by running
Code:
adduser --system --shell /bin/false --no-create-home --group --disabled-login privoxy
Then I passed this info to make with
Code:
make -s install  USER=privoxy GROUP=privoxy
I am not sure how to use the compile time security features of gcc though. I am marking as solved; however, info on compile time security would be helpful.

Hope this helps.
 
Old 01-16-2011, 07:46 AM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
This is how it works for me:
Code:
groupadd -g 73 privoxy
/usr/sbin/useradd -u 73 -g 73 -d /etc/privoxy -r -s "/sbin/nologin" privoxy

Quote:
Originally Posted by mrmnemo View Post
I am not sure how to use the compile time security features of gcc though. (..) info on compile time security would be helpful.
I don't know what you mean by that?
 
Old 01-16-2011, 04:18 PM   #6
mrmnemo
Member
 
Registered: Aug 2009
Distribution: linux
Posts: 527

Original Poster
Rep: Reputation: 51
Quote:
Originally Posted by unSpawn View Post
Code:
groupadd -g 73 privoxy
/usr/sbin/useradd -u 73 -g 73 -d /etc/privoxy -r -s "/sbin/nologin" privoxy
Could you help me understand the above? I can see off the top where I was doing it wrong on the shell. However, what is the '73'? From the man page I thought it was the LOGIN at the end of the command line that was used to define group/user. In your case, is 73 another option? I see the -r for a system service. Is the -d for directory? If so, I think I messed when I built. I PREFIXED to /usr/local/etc rather than /etc/privoxy. That was the default behavior for the build.
 
Old 01-16-2011, 04:56 PM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
No, "73" is the GID and UID (as 'man groupadd' and 'man useradd' should show) which you supply to "-g" and "-u". And using './configure --prefix=/usr/local' is quite different from 'useradd -d /etc/privoxy'. The first just prepares the build to be installed in a part of the file system while the latter just sets the users $HOME.
 
1 members found this post helpful.
Old 01-16-2011, 05:35 PM   #8
mrmnemo
Member
 
Registered: Aug 2009
Distribution: linux
Posts: 527

Original Poster
Rep: Reputation: 51
So 73 is a number you provided? Or, is "73" to GUID as 777 is to umask? Either way, you helped me solve it. Actually, the way you posted the solution seems to be more fine tuned. All my other questions are gonna start getting off topic. Thanks for all your help.

8)

Last edited by mrmnemo; 01-16-2011 at 05:35 PM. Reason: typo
 
Old 01-16-2011, 05:44 PM   #9
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Number, yes. UID or GUID. Not a mask. Cool but don't forget to mark the thread solved.
 
  


Reply

Tags
user option /bin/false



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
Privoxy 3.0.6 - Build Problem win32sux Ubuntu 1 11-06-2007 02:12 AM
Privoxy - "Privoxy is not being used" from http://www.privoxy.org/config/ slimjim Linux - Networking 1 03-12-2007 11:07 AM
LXer: Open-source Tool Gains Traction To Help Build User Interfaces LXer Syndicated Linux News 0 09-09-2006 11:54 PM
Privoxy, editing config in web interface as user craigevil Linux - Networking 1 08-27-2005 10:51 PM
where is linux source build directory/kernel source tree? webazoid Linux - Software 2 07-01-2004 08:37 PM

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

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