Calling stored session from script changes Port #

Advertisement

lravens19
Guest

Calling stored session from script changes Port #

Version 4.3.2. This is a fresh install on a windows server 2003 box. I have a stored session using FTP port 21. The server I'm trying to connect to is behind the same firewall and is a windows server 2003 box as well. I can connect through the GUI perfectly fine. However, when I use a script to automate the process I call winscp and the stored session. It fails to connect to the ftp server because somehow it using port 22.

This is the command I'm using and I use this same exact process on three other servers in about 30 other scripts.

"echo open USERNAME@IP > E:\Filetransfers\ftppgp.txt
echo put *.* >> E:\Filetransfers\ftppgp.txt
echo bye >> E:\Filetransfers\ftppgp.txt
c:\windows\winscp.exe /log=E:\Filetransfers\pgpsrvLog%month%%day%%year%.txt /console /script=E:\Filetransfers\ftppgp.txt"

Here is the log:

". 2011-05-05 19:05:10.085 --------------------------------------------------------------------------
. 2011-05-05 19:05:10.085 WinSCP Version 4.3.2 (Build 1201) (OS 5.2.3790 Service Pack 2)
. 2011-05-05 19:05:10.085 Login time: Thursday, May 05, 2011 7:05:10 PM
. 2011-05-05 19:05:10.085 --------------------------------------------------------------------------
. 2011-05-05 19:05:10.085 Session name: FTPSJH@10.10.16.54
. 2011-05-05 19:05:10.085 Host name: 10.10.16.54 (Port: 22)
. 2011-05-05 19:05:10.085 User name: USERNAME (Password: No, Key file: No)
. 2011-05-05 19:05:10.085 Tunnel: No
. 2011-05-05 19:05:10.085 Transfer Protocol: SFTP (SCP)
. 2011-05-05 19:05:10.085 Ping type: -, Ping interval: 30 sec; Timeout: 15 sec
. 2011-05-05 19:05:10.085 Proxy: none
. 2011-05-05 19:05:10.085 SSH protocol version: 2; Compression: No
. 2011-05-05 19:05:10.085 Bypass authentication: No
. 2011-05-05 19:05:10.085 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: No
. 2011-05-05 19:05:10.085 Ciphers: aes,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2011-05-05 19:05:10.085 SSH Bugs: -,-,-,-,-,-,-,-,-
. 2011-05-05 19:05:10.085 SFTP Bugs: -,-
. 2011-05-05 19:05:10.085 Return code variable: Autodetect; Lookup user groups: Yes
. 2011-05-05 19:05:10.085 Shell: default
. 2011-05-05 19:05:10.085 EOL: 0, UTF: 2
. 2011-05-05 19:05:10.085 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes
. 2011-05-05 19:05:10.085 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No
. 2011-05-05 19:05:10.085 Local directory: default, Remote directory: home, Update: No, Cache: Yes
. 2011-05-05 19:05:10.085 Cache directory changes: Yes, Permanent: Yes
. 2011-05-05 19:05:10.085 DST mode: 1
. 2011-05-05 19:05:10.085 --------------------------------------------------------------------------
. 2011-05-05 19:05:10.085 Looking up host "10.10.16.54"
. 2011-05-05 19:05:10.085 Connecting to 10.10.16.54 port 22
. 2011-05-05 19:05:11.132 Failed to connect to 10.10.16.54: Network error: Connection refused"

Reply with quote

Advertisement

lravens19
Guest

Sorry I lied about the OS of the FTP server I'm trying to connect to. It's a windows 2000 SP4 box.

I have also deleted the stored session and recreated it using a simpler name (ie "test").

Reply with quote

lravens19
Guest

Hi, Thanks for the reply. Yes the username throughout is what you see in the script. I was trying to be "fancy" and remove it from the post. Guess I missed one. I compared the setup of winscp 4.3.2 on this server and another server that does not have any issues. I noticed under storage that it was using Windows registry. So I switched it to INI file and it was able to connect through the script. It ran for two nights fine but now it is back to trying to use the wrong port and will not connect. Is there another setting I'm missing?

Reply with quote

lravens19
Guest

I was just looking through the event logs on the server and the day it stopped working the server rebooted. The ini file is still on the C drive.
"[Sessions\FTPSJH@10.10.16.54]
HostName=10.10.16.54
PortNumber=21
UserName=FTPSJH
FSProtocol=5
Password=Encrypted"

The setting on the stored session is still set to use INI file, but when the script runs it tries to use port 22 when I call the stored session FTPSJH@10.10.16.54.

Reply with quote

Advertisement

lravens19
Joined:
Posts:
17

I'm sorry I should have specified that the server that rebooted is the server I am trying to connect to (call it server1). Server1 is a local server behind the same firewall as the servers I'm running winscp on. To make things even more complicated server1 is our main server we run winscp to ftp files out of our network. Could something on server1 be causing my issues?

Reply with quote

lravens19

Hey Prikryl thank you for that. I found that I was actually calling a shortcut for winscp and not the one in the "program files" location where the ini file is also located. I have to wait until tomorrow morning to see if that makes a difference. I will post tomorrow morning. Thanks again!

Reply with quote

Advertisement

You can post new topics in this forum