specify PORT no. from command line

Advertisement

cprasad111
Joined:
Posts:
5
Location:
singapore

specify PORT no. from command line

when i transfer a file from windows to unix using winscp.com (command line), it does not ask for port number.

when i try the same stuff in putty, the file transfer does not take place unless the PORT is specified.

How to specify the port in command line and why it's not asking for port number?
Does it use a default port (22), In my case, port no. of unix is 22. Is this the reason its not asking for port no. ?
If unix port was other than 22, would it still not ask the port ?

Reply with quote

Advertisement

dan_linder
Guest

Port number on command line is an option.

I have found that if you append the port to the end of the "scp://" URL, it works. Here's an example:
    scp://%username%:%password%@%computername%:%portnum%
Saves the time of writing a custom script.

For what it's worth, I'm using WinSCP 4.3.3 build 1340.

Dan

Reply with quote

SnakeWood
Guest

Failed to connect

I would like to add to this old post that I had a similar issue where I created a scheduled task to ftp a file to a sftp site. By default, it was picking up port 21 which is normal ftp and our firewall was blocking the connection. I added to the connection string :22 and in the log I was seeing that it had picked up the port 22 but still it was failing to connect. Finally, our network people made me change the command from "C:\Program Files (x86)\WinSCP\WinSCP.exe" to "C:\Program Files (x86)\WinSCP\WinSCP.com" and it fixed my problem and was now connecting using port 22. As it is using the command WinSCP instead of the executable.

Thought I should share this in case some people encounter the same issue.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,468
Location:
Prague, Czechia

Re: Failed to connect

SnakeWood wrote:

I would like to add to this old post that I had a similar issue where I created a scheduled task to ftp a file to a sftp site. By default, it was picking up port 21 which is normal ftp and our firewall was blocking the connection. I added to the connection string :22 and in the log I was seeing that it had picked up the port 22 but still it was failing to connect. Finally, our network people made me change the command from "C:\Program Files (x86)\WinSCP\WinSCP.exe" to "C:\Program Files (x86)\WinSCP\WinSCP.com" and it fixed my problem and was now connecting using port 22. As it is using the command WinSCP instead of the executable.

Thought I should share this in case some people encounter the same issue.
Sorry, but this does not make any sense.

Reply with quote

Advertisement

Soren
Guest

Re: Port number on command line is an option.

dan_linder wrote:

I have found that if you append the port to the end of the "scp://" URL, it works. Here's an example:
    scp://%username%:%password%@%computername%:%portnum%
Saves the time of writing a custom script.

For what it's worth, I'm using WinSCP 4.3.3 build 1340.

Dan

Thanks for the help, you're a genious!

Reply with quote

Advertisement

You can post new topics in this forum