LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 06-02-2009, 10:59 AM   #1
digvijay.gahlot
Member
 
Registered: Mar 2008
Posts: 53

Rep: Reputation: 15
Removing unnecessary users from /etc/passwd file


Hi,
I have to remove unnecessary users from /etc/passwd file. I have done with almost all, checking for whether any of my application or system will have any troubles after removing any of them.

I am left with the following users. I need to find out what function does these accounts accomplish & whether their deletion will cause any problems.

man:*:16:20:man:/var/cache/man:/bin/false
proxy:*:19:21roxy:/bin:/bin/false
telnetd:*:20:22roxy:/bin:/bin/false
backup:*:34:34:backup:/var/backups:/bin/false


Thanks in advance.

Digvijay
 
Old 06-02-2009, 11:42 AM   #2
fpmurphy
Member
 
Registered: Jan 2009
Location: /dev/ph
Distribution: Fedora, Ubuntu, Redhat, Centos
Posts: 299

Rep: Reputation: 62
As a general rule do not remove users whose UID is less than 1000. These are system or privledged accounts.
 
Old 06-02-2009, 11:46 AM   #3
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
@fpmurphy: Generally that is good advice, although UID 1000 is a bit high. Some distro's start at 500 with their user accounts (mine does....).
 
Old 06-03-2009, 01:59 AM   #4
digvijay.gahlot
Member
 
Registered: Mar 2008
Posts: 53

Original Poster
Rep: Reputation: 15
Yes I know all about that.

Linux has a list of system users which have specific purpose to solve. I am keeping all of them in the /etc/passwd file.

They are made in order to distribute priviledges.

For Example:-

bin

The bin user account typically owns the executable files for most user commands. This account's primary purpose is to help distribute the ownership of important system directories and files so that everything is not owned solely by the root and sys user accounts.

daemon

The daemon user account exists only to own and run system server processes and their associated files. This account guarantees that such processes run with the appropriate file access permissions.

nobody

The nobody user account is used by the Network File System (NFS) to enable remote printing. This account exists so that a program can permit temporary root access to root users. For example, before enabling Secure RPC or Secure NFS, check the /etc/public key on the master NIS server to find a user who has not been assigned a public key and a secret key. As root user, you can create an entry in the database for each unassigned user by entering:
newkey -u username
Or, you can create an entry in the database for the nobody user account, and then any user can run the chkey program to create their own entries in the database without logging in as root.


I was unable to find purpose of (man, proxy, telnetd, backup).


Thanks for your efforts, it will be nice if any1 posts necessity of the users I mentioned.

Regards
Digvijay
 
Old 06-03-2009, 02:10 AM   #5
rikxik
Member
 
Registered: Dec 2007
Posts: 88

Rep: Reputation: 19
Well, take a safe copy, remove them and you'll find out if they cause any issues
 
Old 06-03-2009, 02:14 AM   #6
ghostdog74
Senior Member
 
Registered: Aug 2006
Posts: 2,697
Blog Entries: 5

Rep: Reputation: 244Reputation: 244Reputation: 244
Quote:
Originally Posted by digvijay.gahlot View Post
Hi,
I have to remove unnecessary users from /etc/passwd file. I have done with almost all, checking for whether any of my application or system will have any troubles after removing any of them.

I am left with the following users. I need to find out what function does these accounts accomplish & whether their deletion will cause any problems.

man:*:16:20:man:/var/cache/man:/bin/false
proxy:*:19:21roxy:/bin:/bin/false
telnetd:*:20:22roxy:/bin:/bin/false
backup:*:34:34:backup:/var/backups:/bin/false


Thanks in advance.

Digvijay
you can use find to find files belonging to these users
Code:
find / -user "man" #similarly for others...
if there aren't any files belonging to them, you can safely delete them
 
Old 06-03-2009, 03:07 AM   #7
digvijay.gahlot
Member
 
Registered: Mar 2008
Posts: 53

Original Poster
Rep: Reputation: 15
Thanks ghostdog74,

Can there be a scenario that any of these user account is used by any program to perform some activity. Like the ftp user account is needed to perform anonymous ftp.

Some special priviledges these account might be providing to system or

Just making sure that not any files belong to them I can safely delete these account ?

Regards
Digvijay
 
Old 06-03-2009, 03:23 AM   #8
rikxik
Member
 
Registered: Dec 2007
Posts: 88

Rep: Reputation: 19
If you don't find any files owned by them and you don't find any processes owned by them running (verify via ps), then how can they be providing any services?
 
Old 06-03-2009, 08:02 AM   #9
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Why??

What problem are you trying to solve?
 
Old 06-03-2009, 08:07 AM   #10
ghostdog74
Senior Member
 
Registered: Aug 2006
Posts: 2,697
Blog Entries: 5

Rep: Reputation: 244Reputation: 244Reputation: 244
Quote:
Originally Posted by pixellany View Post
Why??

What problem are you trying to solve?
its pretty standard thing to do in the security/audit world that if there are dormant or expired or unnecessary users defined in a system, they are to be removed, or disabled. (The best approach is to remove them of course but its up to the policies defined)
 
Old 06-03-2009, 10:47 AM   #11
digvijay.gahlot
Member
 
Registered: Mar 2008
Posts: 53

Original Poster
Rep: Reputation: 15
ghostdog74 Thanks for your support.

Friends thanks a lot for all your efforts. I was able to find all necessary information.

Yes there was a security/audit thing required by our org. So I have to remove all unnecessary accounts but I have to make sure removal of any shouldnt cause any problem in normal functionality of the system.

Thanks again all of you. No further queries from my side.

Regards
Digvijay

Last edited by digvijay.gahlot; 06-03-2009 at 10:49 AM. Reason: appending statement
 
Old 06-03-2009, 11:30 AM   #12
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,332
Blog Entries: 55

Rep: Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533
Quote:
Originally Posted by digvijay.gahlot View Post
Friends thanks a lot for all your efforts. I was able to find all necessary information.
For the benefit of those that find the thread later, could you explain what methods you used to identify the accounts as removable?
 
  


Reply


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
Shell script to list all users in /etc/passwd file milestone Programming 6 09-15-2007 01:57 PM
Deleting unnecessary users/groups Wynd Slackware 3 04-29-2006 10:17 PM
cleaning up. Removing packages that are unnecessary. microsoft/linux Debian 6 10-20-2005 11:35 AM
Removing default users in passwd file? ridertech Linux - Newbie 1 05-08-2004 05:33 PM
Removing unnecessary services and users/groups Jiggy Linux - Security 4 11-18-2003 02:11 PM


All times are GMT -5. The time now is 08:56 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration