Can't get sftp server to accept password from script when entered as part of the "open" command

Advertisement

JackElliott
Joined:
Posts:
6
Location:
Bend, Oregon, USA

Can't get sftp server to accept password from script when entered as part of the "open" command

I'm setting up a script to send files from a Windows 10 computer to a MacOS (Sequoia 15.2) computer and am unable to get the server on the Mac to accept the user password when it is sent as part of the sftp open command.

It works if I leave out the password, here:
open sftp://username@ip-address/ -hostkey="sha - xxx"
The opened terminal window prompts for the username password, like this:
Searching for host...
Connecting to host...
Authenticating...
Using username "username".
Password:
And when the password for username is entered, the script carries on and does its business.

But if I try to automate the process so I don't have to hand-enter the password, like this:
open sftp://username:password@ip-address -hostkey="sha - xxx"
I get this error:
Searching for host...
Connecting to host...
Authenticating...
Using username "username".
Authenticating with pre-entered password.
Access denied.
Authentication failed.
Authentication log (see session log for details):
Using username "username".
Access denied.

Authentication failed.
According to the example on https://winscp.net/eng/docs/scripting#example, the password is put after the username, separated by a colon. So I think I am doing this correctly. But it don't work.

How can I automate this with the password inline with the rest of the open command?

Thank you!

Reply with quote

Advertisement

Guest

Re: Can't get sftp server to accept password from script when entered as part of the "open" command

Thank you. My password is Oddbirds24
I do not see special characters.

Reply with quote

JackElliott

Re: Can't get sftp server to accept password from script when entered as part of the "open" command

Oh dear, I found a typo in my password. My apologies! It's what my wife calls "male pattern blindness" – ouch

Reply with quote

Advertisement

You can post new topics in this forum