Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- PuTTY pscp on Linux in Batch Mode
March 21, 2013, 10:11 pm
rate this thread
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 b
atch 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 per
manently 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.
- Dag-Erling SmÃ¸rgrav
March 22, 2013, 3:11 pm
Re: PuTTY pscp on Linux in Batch Mode
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
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
- » ssh on command line: force using a group size (prime size) of 1024 (and no...
- — Newest thread in » Secure Shell Forum