Hello Automation!
Ashutosh Saxena
Cloud Engineer 2@Amazon Web Services | DevOps tools | 5xRedHat | 4xAWS, 1xGCP | CNCF Speaker | Teacher | Mentor
Hi, in this fast-moving world each one of us wants to be as fast as possible. Such as to get fast service, to get fast results or enhance more optimal ways of doing or performing tasks.
I was just working and adding some local users in my Linux system. Each time I encounter the repetition of tasks or commands. I got fed up. WHAT I AM DOING!!!!
So, I've written two "Shell Scripts" one for normal "user creation" and other for "user creation with password generation". In the second script, the user will get a random password which he or she needs to change after the first login, the same concept is followed in the first script with the exception of random password generation.
Check out the screenshots below to get more and better understanding and see the power of automation:
Here, the script is asking me for a username, full name (Used as a comment) and the password. As the user is created, and when you switch it to the newly created user using your terminal you'll get this:
Here, the user needs to change my password after login.
Now the next work:
Here, the script is asking me for the username as a "parameter" as I enter the username it will take care of the rest.
When you switch, on to the user you need to copy the randomly generated password for the first-time login.
And nowhere, you can change your password.
These scripts are available on my Github account, give it a try!
Software Engineer | NodeJs | TypeScript | MySQL | MongoDB
4 年Well done
Ex- Radisys | Software Engineer(Devops) at SAP Labs India
4 年Went through the code hosted on github, in password_generation why we are using an sha256sum, which includes a or condition with head to see first 20 line ? The code seems good, will check if can any modification to make it more reliable. And also a good work it can save a lot of time while creating multiple user logins.