07-25-2013 03:35 PM - edited 07-25-2013 03:38 PM
Hi there,
Here is how you solve this problem.
1) You have to upload the putty.exe file onto that Windows box.
2) Login to the Windows box using the account that will be in the batch script.
3) Run putty.exe and try to ssh to that other Linux/Unix box.
* You will then see a window pop up to accept the ssh-rsa2 key of the Linux box (this window will only pop up the first time you
try to ssh to the Linux box); after you click Yes on that window, the ssh-rsa2 key of the Linux box will be stored into the
Windows registry, under SSHHostKey
* It is also important that you have to be logged in to that Windows box with the account that you will use in your scheduled
task of the batch job.
4) Now inside your batch script, you can use pscp, psftp, plink, etc ... with the -pw option to specify the password right on the
command line, and it will not ask you to accept the rsa-ssh key because it has been stored into the Windows registry already.
Let me know if it works.
04-01-2021 10:41 AM - edited 04-01-2021 10:50 AM
When using SSH, upon first connection you are required to verify a service host key in order to make a connection.
Through plink, the command line will generate a prompt, asking the user to "accept service host key? (y/n)".
Step 1: Fix the "Keyboard Interactive Authentication prompts from server"
Follow the URL instruction and Deselect the "Attempt keyboard Interactive auth (SSH-2) in your putty.
Step 2: Below is the commands will fix the "verify a service host key" for every Linux server first SSH connection using plink.
echo yes| C:\PuTTY\plink.exe user-name@10.148.147.41 -pw *************** date
Step 3: Now you can immediately ran your next scripts like "server uptime checks" or "monitoring agent restart" using plink with -batch option (disable all interactive prompts)
C:\PuTTY\plink.exe -batch user-name@10.148.147.41 -pw *************** -m C:\uptime_linux.sh
C:\PuTTY\plink.exe -batch user-name@10.148.147.41 -pw *************** -m C:\monitoring-agent-check_linux.sh
Above mentioned information's 100% will help you to automate the Linux tasks using plink utility.
04-01-2021 10:50 AM
When using SSH, upon first connection you are required to verify a service host key in order to make a connection.
Through plink, the command line will generate a prompt, asking the user to "accept service host key? (y/n)".
Step 1: Fix the "Keyboard Interactive Authentication prompts from server"
Follow the URL instruction and Deselect the "Attempt keyboard Interactive auth (SSH-2) in your putty.
Step 2: Below is the commands will fix the "verify a service host key" for every Linux server first SSH connection using plink.
echo yes| C:\PuTTY\plink.exe user-name@10.148.147.41 -pw *************** date
Step 3: Now you can immediately ran your next scripts like "server uptime checks" or "monitoring agent restart" using plink with -batch option (disable all interactive prompts)
C:\PuTTY\plink.exe -batch user-name@10.148.147.41 -pw *************** -m C:\uptime_linux.sh
C:\PuTTY\plink.exe -batch user-name@10.148.147.41 -pw *************** -m C:\monitoring-agent-check_linux.sh
Above mentioned information's 100% will help you to automate the Linux tasks using plink utility.