Command-Line question

Advertisement

Command Line Commando
Guest

Command-Line question

Hey, does anybody know why this doesn't work:

"C:\Program Files\WinSCP3\winscp3.exe" sftp://%USERNAME%@my.ssh.server.com

Using the above command line winscp tries to log me in as user "sftp". I think I have the syntax right, and this does work:

"C:\Program Files\WinSCP3\winscp3.exe" %USERNAME%@my.ssh.server.com

The problem with the latter is that it will use whatever protocol is set as the default. Different users have different defaults. I need something like the former to work so that users can connect to Windows OpenSSH servers.



A little background info for the curious: we have several computers in our office including both Linux and Windows systems. I'd like to find a nice generic way of letting people securely move files between them. Thus I have OpenSSH servers running on all of the systems.

On the Windows systems, I've put a menu on the "All Users" Start Menu which has "Transfer files to (this or that computer)" entries. These entries call up WinSCP with the second syntax I gave above. This works fine when connecting to a Linux system, but only works with Windows systems when the user has set SFTP to the default. I'd like to eliminate this issue without changing SSH servers (though I suppose that is an option). Giving out instructions to all of the users is one possibility, but I'd like to avoid that as well... some people won't understand, or will change the default back at a later time and then wonder why things broke.

Reply with quote

Advertisement

Command Line Commando
Guest

Duh... never mind, I figured it out.

The problem, of course, was that this feature was only added recently. I must have had 2+ month-old versions of WinSCP installed. Updating them fixed the problem.

Reply with quote

Miisha
Guest

I think the problem is that program supposes syntax uname[:password]@host, so when You use sftp://username@host then it is decoded like uname="sftp", password="//username".

Reply with quote

Advertisement

You can post new topics in this forum