• 4

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191


File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 191
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

Change account password remotely via Plink

Here's my current predicament: I need to change the password to a user account on 2000 devices running Ubuntu 16.04. I want to do this remotely via Plink rather than SSH. On all these appliances, the username is TESTUSER and password is TESTPASS. In short, they all have the same username and password.

Plink script executed via CMD: FOR /F "tokens=1,2* delims=," %G IN (C:\Users\username\Desktop\TEST\Device_IPs.txt) DO echo y | plink -v -ssh -m "C:\Users\username\Desktop\TEST\commands.txt" TESTUSER@%G -pw TESTPASS >> Results.txt 2>&1

In my commands.txt file is echo TESTUSER:TESTPASSNEW | chpasswd

The above command works via SSH flawlessly but only with elevated sudo privileges. In other words:

  1. SSH to device
  2. sudo -i
  3. Input TESTPASS as password
  4. Run echo TESTUSER:TESTPASSNEW | chpasswd

TESTPASSNEW is what I'd like to change the password to. Any suggestions are appreciated!

    • Small correction: I simply do a sudo -i then I run the command not with TESTUSER@Hostname but with root@Hostname. But I cannot SSH to the device using root/password method. I have a less than novice understanding of Linux but hoping people smarter than I am understand what's going on

Warm tip !!!

This article is reproduced from Stack Exchange / Stack Overflow, please click

Trending Tags