Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 912433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T17:22:43+00:00 2026-05-15T17:22:43+00:00

Currently our process consists of logging into each *nix server and manually changing the

  • 0

Currently our process consists of logging into each *nix server and manually changing the password for each. My question is, what is a good way to automate this? I’m thinking of possibly a couple different ways to do this and would like input from others on what they recommend, use, etc.

One way I was thinking is a text file with a list of servers that need the password change and a script that prompts the user for the new password, stores it temporarily in the script and then remote connects into each server and runs the commands. Having a check to make sure the server is reachable or a timeout on the remote connection would be a good idea. Then have output to the console so the person running the script can see what servers were successful and which ones were not.

I was trying to think of another fully automated solution, but couldn’t think of a good way to securely store the new password. Plus it is not a huge deal to me to have some user interaction and have to manually start the script as we only would need to do this 6 times a year.

Any thoughts, help, ideas would be greatly appeciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T17:22:44+00:00Added an answer on May 15, 2026 at 5:22 pm
    openssl passwd -1 $rootpw
    

    Where $rootpw holds the string that will be your root password.

    This will output a crypted string that you can just put in the file or whatever. I use this on a script that sets up virtual server instances that are provisioned from a database. I compute this hash before sending it over the network so the script that sets up the server can just use this hash instead of having to send it plain text.

    To answer your question, each server would compute the hash slightly differently and result in a different hash, but all of those hashes would equate to the same password. You could use any one of these hashes and they would be functionally equivalent when used on any server, even though the actual content of the hash is different.

    For example, I hashed foobar and these are the results:

    rootpw=foobar
    openssl passwd -1 $rootpw
    $1$6pXamKGD$TKQqON1prArop7DpLOyAk1
    
    openssl passwd -1 $rootpw
    $1$4A4Mn16f$P7ap2AqNMRK8m72bG/Bve0
    
    openssl passwd -1 $rootpw
    $1$DyhsWEMX$i2wH6JpAqoHNFZ0YOBVHj/
    
    openssl passwd -1 $rootpw
    $1$m27FIj5e$LZPxVniAeUoZcuUoNHK8c/
    
    openssl passwd -1 $rootpw
    $1$qdX0NKm1$45rzxUj..LCJwWB/.fwGH0
    

    Each of those hashes are different even when computed on the same machine but any of them can be used to equate to the password ‘foobar’ on any machine.

    So just open /etc/shadow and paste that in there where you find the line:

    root:$1$qdX0NKm1$45rzxUj..LCJwWB/.fwGH0:14415:0:99999:7:::
    

    In my script I explode it at the :’s and update element [1] then concatenate the array back to a string and replace the string in the file. You can do it differently if you want, especially if you know the old value (which you can get by exploding it into an array).

    I know this question is a few months old so you probably figured it out, but I’m putting this out there for any future googler’s coming along and finding this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently our developent enviroment consists of a Dev server, a Staging server and a
I'm currently evaluating ivy, maven and buckminster to ease our build process. Conceptually buckminster
I'm currently in the process of testing our solution that has the whole gamut
We’re currently in the process of updating the email dispatch part of our application
We don't currently have our SQL Server objects in any form of source control.
Our environment consists of Project Server 2007 and MOSS 2007. We have around 750
Currently our Java application uses the values held within a tab delimited *.cfg file.
I'm setting up some monitoring on a few SQL Servers. Currently our environment uses
I'll try to make this as straight forward as possible. Currently our team has
Currently all our files are stored on a Windows network drive and with 15

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.