1

I have created a openSSH SCP bat script and scheduled task to run as SYSTEM. I use publickkey authentication method. For that converted a private key of winscp to openSSH key using putty key gen and set permission of private key file read access only for SYSTEM user and changed file owner too.

So when task runs it succesfully connects and works fine but sometimes its getting stuck without any error and task scheduler stuck i nrunning state.

In logs, it shows

debug1: AUthentications that can continue :publickey,gssapi-keyex,gssapi-with-mic,keyboard-interactive
debug1: Next Authentication method : publickkey
debug1:Trying private key:d:/apps/keys/prvikey
debug1: AUthentications that can continue :publickey,gssapi-keyex,gssapi-with-mic,keyboard-interactive
debug1: Next Authentication method : keyboard-interactive
debug1: read_passphrase:can't open /dev/tty:No such file or directory

After that if i go and end task scheduler process and kill any cmd.exe waiting for scp.exe PID and run again it works sometimes and failes sometimes.

Windows OS: Windows server 2012

Command used:

scp -v -i D:\apps\keys\prvikey D:\apps\file* [email protected]:\ftp\rcvfile\
1
  • i found that with scp-vvv option , when the connectiion fail i see the return packet type is 51 but succesfull case return npacket type is 52 when authentication fails : * debug3: send packet: type 50 debug2: we sent publickkey packet, wait for reply debug3: receive packet : type 51 debug1: AUthentications that can continue :publickey,gssapi-keyex,gssapi-with-mic,keyboard-interactive*
    – TAMIL VED
    Feb 1, 2021 at 8:21

0

You must log in to answer this question.