Operating System - OpenVMS
1753797 Members
7833 Online
108805 Solutions
New Discussion юеВ

Re: SFTP in batch mode - Re: thread 985928

 
Steven Schweda
Honored Contributor

Re: SFTP in batch mode - Re: thread 985928

> Now I am unable to get it to read my batch
> file for the account password. Any ideas on
> how to pass this password in?

Which "account password"? What, exactly, are
you doing, and with what? Around here:

alp $ sftp sms@alp
sftp> pwd
ALP$DKA0:[SMS]
sftp> quit


Once I'm in, I'm in. I have no idea where
I'd put another password.

Batch file, shmatch file. Can you make this
task go interactively? When you can, provide
a transcript, and then we can worry about how
to automate it further.
Erik Harclerode
Advisor

Re: SFTP in batch mode - Re: thread 985928

Hi,
I've always been able to run it interactively but now I'm trying to automate the login process so I can then automate an upload each day.

The password I'm referencing is one given to me from the receiver. They gave me a user name and password to access their system.

here is what it looks like:

$ sftp plmweb
This is a private system.
Unauthorized access is prohibited and will
userid@www.plmweb.org's password:
sftp> ls
.
Download
sftp>
Steven Schweda
Honored Contributor

Re: SFTP in batch mode - Re: thread 985928

> [...] once I created a new key without a
> password I am able to authenticate without
> a problem.

Apparently not. Perhaps you could provide a
transcript showing how you arrived at that.
Or does "without a problem" not imply
"without a password"?

> $ sftp plmweb
> This is a private system.
> Unauthorized access is prohibited and will
> userid@www.plmweb.org's password:

That would seem not to be using a key which
works without a password. (Or any key at
all. It looks like "password"
authentication, not "hostbased" or
"publickey".)

Adding "-v" to your SSH or SFTP command
should show you more about which
authentication method were attempted, and
which one actually worked, along with other
potentially interesting details.
Erik Harclerode
Advisor

Re: SFTP in batch mode - Re: thread 985928

Hi Steve,
Initially I had a password on my SSH key, so when I SFTP'd to the server it would ask me for two sets of information. First it would ask me for a password for my SSH key. Once authenticated there it would ask me for a different account password, which is completely UNRELATED to the SSH key. This account password was provided by the people I'm trying to connect to.

Now, I've created a new SSH key WITHOUT a password and am able to connect to their system and not have to enter my SSH password, but it still asks for the account password. So in a sense there are two levels of security, one with the SSH key and another with a simple user name and password login. The new SSH key without the password gets me through the first door but now I need to figure out a way to feed the account password to the prompt so I can get completely onto their system.

I hope this clears things up.
Thanks,
Erik
Richard Whalen
Honored Contributor

Re: SFTP in batch mode - Re: thread 985928

Since it is still asking you for the account password my first guess is that the public key authentication is failing. Try doing an SSH with /DEBUG=4, if you see a line containing "Method 'publickey' disabled.", then you'll have confirmation that it is just moving from one authentication method to the next.
Erik Harclerode
Advisor

Re: SFTP in batch mode - Re: thread 985928

I have confirmed with the people that I'm connecting with that the account password is required after authentication.
Richard Whalen
Honored Contributor

Re: SFTP in batch mode - Re: thread 985928

If account password is required, then they must have a line equivalent to this in their configuration file:

RequiredAuthentications password

Unfortunately, you are not going to get it to work in batch mode in this case.
Erik Harclerode
Advisor

Re: SFTP in batch mode - Re: thread 985928

Ok, closing this thread. I finally got it to work. I convinced the people to let me have a single authentication and remove the account password piece of this problem. Now I am able to login without any problems.

thanks to all who helped!
Steven Schweda
Honored Contributor

Re: SFTP in batch mode - Re: thread 985928

> I convinced [...]

If you told me that the extra password
would end up being stored in a file
somewhere, then I'd sure be willing to forgo
the extra "security".
Erik Harclerode
Advisor

Re: SFTP in batch mode - Re: thread 985928

Solution Found!