Topic "specify PORT no. from command line"

Author Message
cprasad111
[View user's profile]

Joined: 2012-09-25
Posts: 5
Location: singapore
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 ?
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26553
Location: Prague, Czechia
WinSCP uses the default port number for the protocol you are using. What is 22 for SSH.
If you need to specify different port, see:
https://winscp.net/eng/docs/scriptcommand_open
https://winscp.net/eng/docs/session_url
_________________
Martin Prikryl
dan_linder

Guest


I have found that if you append the port to the end of the "scp://" URL, it works. Here's an example:
Code:
    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
SnakeWood

Guest


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.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26553
Location: Prague, Czechia
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.
Advertisements

You can post new topics in this forum






Search

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License