简体   繁体   中英

SSH from windows Jenkins slave to Linux

I have a windows jenkins slave.From this slave i want to SSH in linux.

Below i have given in Jenkinsfile

  bat 'ssh -p 22 -pw Qwerty@118 pxx1g9x@1x.1xx.13x.3x'

Here,pxx1g9x is the user and Qwerty@118 is the password for this user.1x.1xx.13x.3x is Ip of linux machine.

But this is giveing me below error

   ssh: Could not resolve hostname 118: No such host is known. 

I'm not sure whether you can directly pass the password as an argument in ssh, However, you might want to try adding the public key of the slave to the authorized hosts on the linux system.

You can see how it is done here. https://www.tecmint.com/ssh-passwordless-login-using-ssh-keygen-in-5-easy-steps/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM