Last active
October 12, 2015 01:38
-
-
Save benoitjpnet/3951907 to your computer and use it in GitHub Desktop.
Get useradd command for migrating account
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in user1 user2 user3...; do echo -n 'useradd -m -s /bin/bash -u '$(grep -E "^$i" /etc/passwd | cut -d':' -f3) && echo -en ' -p' \'$(grep -E "^$i" /etc/shadow | cut -d ':' -f2)\' $i '\n'; done | |
Output : | |
useradd -m -s /bin/bash -u USERID -p 'USERPWD' username |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment