Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PuTTY pscp on Linux in Batch Mode

198 views
Skip to first unread message

ter0...@gmail.com

unread,
Mar 21, 2013, 6:11:53 PM3/21/13
to
Hello all,

I am working with an application, running on Linux that actually uses pscp on Linux itself (compiled into /usr/local/bin/pscp).

I've noticed that, when run, pscp stores its cache in ~/.putty/sshhostkeys. So, if I connect to a new server, and asked if I want to store the key, I type "y" and it is stored there for future sessions.

However, the application I'm working with uses pscp in batch mode. So, when the prompt comes up to verify a host key, it automatically fails because batch mode fails on interactive prompts.

My question is how do I tell pscp in batch mode to permanently accept that key? Does PuTTY on Linux store another, global cache somewhere that it can read? On Windows, I believe it uses the registry, which thankfully doesn't exist on Linux. Is it possible to run pscp in batch mode and have it permanently accept a key so that the prompt is no longer interactive?

Thanks for any help. I've used PuTTY on Windows as a client for years, but never really seen it used in a Linux environment as typically scp/sftp/ssh (openssh) is sufficient.

Regards,
Tom

Dag-Erling Smørgrav

unread,
Mar 22, 2013, 11:11:17 AM3/22/13
to
ter0...@gmail.com writes:
> I am working with an application, running on Linux that actually uses
> pscp on Linux itself (compiled into /usr/local/bin/pscp).

Why not use OpenSSH's scp or (preferably) sftp client instead?

DES
--
Dag-Erling Smørgrav - d...@des.no

Simon Tatham

unread,
Mar 22, 2013, 11:28:52 AM3/22/13
to
<ter0...@gmail.com> wrote:
> I've noticed that, when run, pscp stores its cache in
> ~/.putty/sshhostkeys.
[...]
> However, the application I'm working with uses pscp in batch mode. So,
> when the prompt comes up to verify a host key, it automatically fails
> because batch mode fails on interactive prompts.
>
> My question is how do I tell pscp in batch mode to permanently accept
> that key? Does PuTTY on Linux store another, global cache somewhere
> that it can read?

No, it _should_ still use the same cache file whether it's in batch or
interactive mode. If it isn't working for you, that's something we
should try to debug.

Are you running the batch-mode pscp in the same environment as the
test interactive one? If you run as a different user or change $HOME,
then the location of the sshhostkeys file will also change. Users can
also set $PUTTYDIR to read configuration from somewhere else.

If you run pscp -batch under strace, can you see in the trace where
it's trying to open a host key file, and check it's finding the right
one?

If you use the -v flag in both the batch and interactive runs, do they
report the same host key fingerprint?
--
Simon Tatham "_shin_, n. An ingenious device for
<ana...@pobox.com> finding tables and chairs in the dark."

0 new messages