Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm unable to run a script in linux using plink.exe. I'm using my user x to login and script is under y user, which I need to sudo to y and run it. I was able to at command prompt manually but not through script (for automation).

plink.exe -v -t -l user(x) -pw ****** -ssh hostname "sudo su -y /abc/abc/"

its asking the password again. i was stuck there

Started a shell/command
[sudo] password for X:
share|improve this question

You could configure sudo on your remote host to allow user-X to execute your script without password authentication:

 # or new include file in /etc/sudoers.d/

 user-X ALL=(user-Y) NOPASSWD: /abc/abc/

And normally you don't run sudo to execute su but switch directly to the user you want to run your commands as with something like:

 sudo -u user-Y  /abc/abc/
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.