HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Legacy
- >
- Secure OS Software for Linux
- >
- Re: Root user list
Secure OS Software for Linux
        1839880
        Members
    
    
        3733
        Online
    
    
        110156
        Solutions
    
Forums
        Categories
Company
Local Language
                
                  
                  back
                
        
                
        
                
        
                
        
        
        
                
        
                
        
        
        
                
        
              
              Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
                
                  
                  back
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
            
                
            
                
            
                
            
                
            
            
                
            
                
            
            
                
            
                
              
            Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
        Information
        Community
Resources
Community Language
        Language
        Forums
Blogs
Topic Options
			
				
					
	
			
		
	- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2009 08:51 PM
04-07-2009 08:51 PM
			
				
					
						
							Root user list
						
					
					
				
			
		
	
			
	
	
	
	
	
			
				
					
					
						Hi there,
Is there is a command-line or script available which can generate a report of all accounts with root user equivalent privileges in Linux(SUSE and Redhat) setup, with added information on which machine the id resides., etc?
Thanks,
Venkatesh
		
		
	
	
	
Is there is a command-line or script available which can generate a report of all accounts with root user equivalent privileges in Linux(SUSE and Redhat) setup, with added information on which machine the id resides., etc?
Thanks,
Venkatesh
		3 REPLIES 3
	
	            
            
		
		
			
            
                - Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2009 10:43 PM
04-07-2009 10:43 PM
			
				
					
						
							Re: Root user list
						
					
					
				
			
		
	
			
	
	
	
	
	
			
				
					
					
						Hi
accounts that privileges equal root have uid 0. So you can find them like
# awk -F: '{ if ( $3==0 ) print $1 " " $5 }' /etc/passwd
this will print accountname "$1" and comment field "$5" of password file foreach uid-zero account.
Put it into a file e.g. "uid0.awk" and execute it on all your systems.
for H in $HOSTLIST; do
scp uid0.awk ${H}:/tmp/
echo "Host: $H"
ssh -x $H "sh /tmp/uid0.awk"
done
This may be a starting point for your.
rgds
HGH
					
				
			
			
				
			
			
				
			
			
			
			
			
			
		
		
		
	
	
	
accounts that privileges equal root have uid 0. So you can find them like
# awk -F: '{ if ( $3==0 ) print $1 " " $5 }' /etc/passwd
this will print accountname "$1" and comment field "$5" of password file foreach uid-zero account.
Put it into a file e.g. "uid0.awk" and execute it on all your systems.
for H in $HOSTLIST; do
scp uid0.awk ${H}:/tmp/
echo "Host: $H"
ssh -x $H "sh /tmp/uid0.awk"
done
This may be a starting point for your.
rgds
HGH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2009 02:10 AM
04-08-2009 02:10 AM
			
				
					
						
							Re: Root user list
						
					
					
				
			
		
	
			
	
	
	
	
	
			
				
					
					
						Another appoach is to use uname -n
to get the machine name in your script
uname -n
grep :0: passwd | awk -F ":" '{ print $1 '}
I assume you know how to cook the script,
otherwise let us know - we help
					
				
			
			
				
		
		
	
	
	
to get the machine name in your script
uname -n
grep :0: passwd | awk -F ":" '{ print $1 '}
I assume you know how to cook the script,
otherwise let us know - we help
	Look before you leap
			
			
				
			
			
			
			
			
			
		- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2009 05:30 AM
04-08-2009 05:30 AM
			
				
					
						
							Re: Root user list
						
					
					
				
			
		
	
			
	
	
	
	
	
			
				
					
					
						>>>  all accounts with root user equivalent privileges
This should include a report of SUDO users, and a list of users who knows the root password and can su to root (or member of the wheel group if su has been restricted.
		
		
	
	
	
This should include a report of SUDO users, and a list of users who knows the root password and can su to root (or member of the wheel group if su has been restricted.
	Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
			
			
				
			
			
			
			
			
			
		The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
		
	
	
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP
