0

As I am in IT Admin job which requires managing Windows & Linux servers of an organization, the real pain is changing passwords. For Windows, I am able to change from Active Directory itself which syncs the passwords in real time; but the real struggle is changing Linux passwords as they contain only local ids. We usually set root password to a default one which the user is not aware of & provide them local ids like admin-l1/l2. We use SSO application which doesn't require user to input any password on their side while accessing servers.

Long story short, I need to change user's passwords remotely for Linux devices. I was recommended using plink for achieving the same, but I am facing little issue while resetting the passwords.

Sharing the code below: plink.exe -t root@X.X.X.X -pw Password -no-antispoof "passwd admin-l1;echo 'newpassword';echo 'newpassword'"

The issue lies when the echo commands won't work. Am I doing anything wrong? do let me know.

I have tried a command which I tested but failed.

Where I am going & what changes I need to make in order for this to work

Thank you in advance.

  • If you login to the server and type `passwd admin-l1;echo 'newpassword';echo 'newpassword'` on the commandline – would it change the password? No it won't. So your problem has nothing do with Plink. The problem is your command. – Martin Prikryl Jul 21 '23 at 15:40
  • So what would the correct way be? – Vishaal Tashi Jul 22 '23 at 15:09
  • Does this answer your question? [Using the passwd command from within a shell script](https://stackoverflow.com/questions/714915/using-the-passwd-command-from-within-a-shell-script) – Martin Prikryl Jul 26 '23 at 06:20

0 Answers0