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.