Putty won't cache the keys to access a server when run script in hudson

前端 未结 9 1626
無奈伤痛
無奈伤痛 2020-12-05 03:59

I had a simple automation process to write which needed to copy a few files from linux server to windows via SSH. This can be accomplished using putty.

SSH, as part

9条回答
  •  孤街浪徒
    2020-12-05 05:01

    As of 9 Sep 2014 with the corresponding version of plink (tested with plink 0.66), you can use the -hostkey option, as documented here:

    http://www.chiark.greenend.org.uk/~sgtatham/putty/wishlist/accept-host-keys.html

    Using the key in the original question:

    plink -hostkey cc:78:13:a3:68:a6:59:7e:b8:23:2d:13:3e:66:9b:b9 user@remote 
    

    I successfully used "-hostkey" in my scripts to get around the initial host key prompting problem.

    "-hostkey" is also documented to work with pscp (version 0.66).

    Note that you have to change the hostkey if you change hosts or the sshd server recalculates the key.

提交回复
热议问题