HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Merge user accounts and passwd file
Operating System - HP-UX
        1839836
        Members
    
    
        2921
        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
	
		
			
            
                
            Go to solution
        
            
		
		
			
            	
	
		
        
		
	
	
		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
11-30-2003 08:41 PM
11-30-2003 08:41 PM
			
				
					
					
						Hi, I am merging two L2000 onto an RP5430. I have to merge two sets of users and two passwd files. Some of the users are on both servers. Has anyone got any idears on how I could action this
					
				
			
			
				
	
			
				
		
			
			
			
			
			
			
		
		
		
	
	
	
	Which does not kill you only makes you stronger
			
			
				Solved! Go to Solution.
		3 REPLIES 3
	
	            
            
		
		
			
            
                - Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2003 09:24 PM
11-30-2003 09:24 PM
Solution
			
				
					
					
						You could simply try something like 'cat passwd1 passwd2 | uniq > passwd3', but uniq works better on sorted files which could mess you passwd file (it's better to get system logins at the beginning of the file). A more sophisticated script could do it. Whatever you choose, think about using 'pwck newfile' before overidding real password file.
#!/usr/bin/sh
PASS1=$1
PASS2=$2
NEWPASS=$3
TMP=/tmp/newpass$$
cp $PASS1 $TMP
chmod 644 $TMP
for USER in $(cut -f1 -d: $PASS2)
do
grep "$USER:" $PASS1 || grep "$USER:" $PASS2 | line >> $TMP
done
pwck $TMP
mv $TMP $NEWPASS
chmod 444 $NEWPASS
Regards.
		
		
	
	
	
#!/usr/bin/sh
PASS1=$1
PASS2=$2
NEWPASS=$3
TMP=/tmp/newpass$$
cp $PASS1 $TMP
chmod 644 $TMP
for USER in $(cut -f1 -d: $PASS2)
do
grep "$USER:" $PASS1 || grep "$USER:" $PASS2 | line >> $TMP
done
pwck $TMP
mv $TMP $NEWPASS
chmod 444 $NEWPASS
Regards.
	It works for me (© Bill McNAMARA ...)
			
			
				
			
			
			
			
			
			
		- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2003 09:33 PM
11-30-2003 09:33 PM
			
				
					
						
							Re: Merge user accounts and passwd file
						
					
					
				
			
		
	
			
	
	
	
	
	
			
				
					
					
						I would add one thing to the above post.
 
You will need to make sure that users that appear on both systems have the same UID and if they don't, come up with some strategy to resolve them. You could find that a user on both machines will have a UID on one machine that conflicts with a user on the other. These issues can become quite annoying when the user is an application specific user.
		
		
	
	
	
You will need to make sure that users that appear on both systems have the same UID and if they don't, come up with some strategy to resolve them. You could find that a user on both machines will have a UID on one machine that conflicts with a user on the other. These issues can become quite annoying when the user is an application specific user.
	Never preceed any demonstration with anything more predictive than "watch this"
			
			
				
			
			
			
			
			
			
		- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2003 10:43 PM
11-30-2003 10:43 PM
			
				
					
						
							Re: Merge user accounts and passwd file
						
					
					
				
			
		
	
			
	
	
	
	
	
			
				
					
					
						Hi
As said you will have to be careful
diff passwd_server1 passwd_server2 will help
But if you are not looking at a great number it will be quicker and safer to create from scratch.
Paula
		
		
	
	
	
As said you will have to be careful
diff passwd_server1 passwd_server2 will help
But if you are not looking at a great number it will be quicker and safer to create from scratch.
Paula
	If you can spell SysAdmin then you is one - anon
			
			
				
			
			
			
			
			
			
		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
