FTPS implicit via Powershell: 530 User cannot log in

Advertisement

malva
Joined:
Posts:
7

FTPS implicit via Powershell: 530 User cannot log in

I have a problem connecting to my FTPS server from Powershell. From GUI my username/pass works.
Maybe there's a problem that username is ftp.something.com|USER ?
Please help.


Here's log:


. 2014-10-24 13:42:52.187 --------------------------------------------------------------------------
. 2014-10-24 13:42:52.187 Script: Retrospectively logging previous script records:
> 2014-10-24 13:42:52.187 Script: option batch on
< 2014-10-24 13:42:52.187 Script: batch on
> 2014-10-24 13:42:52.187 Script: option confirm off
< 2014-10-24 13:42:52.187 Script: confirm off
> 2014-10-24 13:42:52.187 Script: open -implicit -certificate="xxxxxx" -passive=1 -timeout=15 ftp://ftp.xxxx.com%7CUSER:***@ftp.xxx.com:990
. 2014-10-24 13:42:52.187 --------------------------------------------------------------------------
. 2014-10-24 13:42:52.187 Session name: ftp.xxxx.com|USER@ftp.xxxxx.com (Ad-Hoc site)
. 2014-10-24 13:42:52.187 Host name: ftp.xxxx.com (Port: 990)
. 2014-10-24 13:42:52.187 User name: ftp.xxx.com|USER (Password: Yes, Key file: No)
. 2014-10-24 13:42:52.187 Tunnel: No
. 2014-10-24 13:42:52.187 Transfer Protocol: FTP
. 2014-10-24 13:42:52.187 Ping type: C, Ping interval: 30 sec; Timeout: 15 sec
. 2014-10-24 13:42:52.187 Proxy: none
. 2014-10-24 13:42:52.187 Send buffer: 262144
. 2014-10-24 13:42:52.187 UTF: 2
. 2014-10-24 13:42:52.187 FTP: FTPS: Implicit TLS/SSL; Passive: Yes [Force IP: A]; MLSD: A [List all: A]
. 2014-10-24 13:42:52.187 Session reuse: Yes
. 2014-10-24 13:42:52.187 TLS/SSL versions: TLSv1.0-TLSv1.2
. 2014-10-24 13:42:52.187 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2014-10-24 13:42:52.187 Cache directory changes: Yes, Permanent: Yes
. 2014-10-24 13:42:52.187 DST mode: 1; Timezone offset: 0h 0m
. 2014-10-24 13:42:52.187 --------------------------------------------------------------------------
. 2014-10-24 13:42:52.441 Connecting to ftp.xxxxx.com:990 ...
. 2014-10-24 13:42:52.498 Connected with ftp.xxxxx.com:990, negotiating TLS connection...
. 2014-10-24 13:42:52.625 Verifying certificate for "xxxx" with fingerprint xxxxxxxx
. 2014-10-24 13:42:52.625 Certificate common name "ftp.xxxxx.com" matches hostname
. 2014-10-24 13:42:52.625 Using TLSv1.2, cipher TLSv1/SSLv3: RC4-SHA, 2048 bit RSA
. 2014-10-24 13:42:52.626 TLS connection established. Waiting for welcome message...
< 2014-10-24 13:42:52.626 220 Microsoft FTP Service
> 2014-10-24 13:42:52.626 USER ftp.xxxx.com|USER
< 2014-10-24 13:42:52.674 331 Password required
> 2014-10-24 13:42:52.675 PASS ********
< 2014-10-24 13:42:52.724 530 User cannot log in.
. 2014-10-24 13:42:52.724 Connection failed.
. 2014-10-24 13:42:52.727 Password prompt (last login attempt failed)

Reply with quote

Advertisement

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

Re: FTPS implicit via Powershell: 530 User cannot log in

Please attach a log from GUI.

Maybe there's a problem that username is ftp.something.com|USER ?
Thanks does not seem to be the problem. As you can see in the log, correct username is passed to USER command.

Reply with quote

malva
Joined:
Posts:
7

What I discovered is that no matter what I will post in $session.remotePath, in logs there is always "home".


GUI log shows correct path.


. 2014-10-27 10:25:31.208 Connecting to ftp..com:990 ...
. 2014-10-27 10:25:31.262 Connected with ftp.com:990, negotiating TLS connection...
. 2014-10-27 10:25:31.439 Verifying certificate for "." with fingerprint
. 2014-10-27 10:25:31.440 Certificate common name "ftp.com" matches hostname
. 2014-10-27 10:25:31.440 Using TLSv1.2, cipher TLSv1/SSLv3: RC4-SHA, 2048 bit RSA
. 2014-10-27 10:25:31.468 TLS connection established. Waiting for welcome message...
< 2014-10-27 10:25:31.468 220 Microsoft FTP Service
> 2014-10-27 10:25:31.468 USER ftp.com|USER
< 2014-10-27 10:25:31.529 331 Password required
> 2014-10-27 10:25:31.529 PASS **********
< 2014-10-27 10:25:31.636 230-Directory has 214,414,741,504 bytes of disk space available.
< 2014-10-27 10:25:31.636 230 User logged in.
> 2014-10-27 10:25:31.636 SYST
< 2014-10-27 10:25:31.744 215 Windows_NT
> 2014-10-27 10:25:31.744 FEAT
< 2014-10-27 10:25:31.832 211-Extended features supported:
< 2014-10-27 10:25:31.832 LANG EN*
< 2014-10-27 10:25:31.832 UTF8
< 2014-10-27 10:25:31.832 AUTH TLS;TLS-C;SSL;TLS-P;
< 2014-10-27 10:25:31.843 PBSZ
< 2014-10-27 10:25:31.843 PROT C;P;
< 2014-10-27 10:25:31.843 CCC
< 2014-10-27 10:25:31.843 HOST
< 2014-10-27 10:25:31.843 SIZE
< 2014-10-27 10:25:31.843 MDTM
< 2014-10-27 10:25:31.843 REST STREAM
< 2014-10-27 10:25:31.843 211 END
> 2014-10-27 10:25:31.843 OPTS UTF8 ON
< 2014-10-27 10:25:31.939 200 OPTS UTF8 command successful - UTF8 encoding now ON.
> 2014-10-27 10:25:31.939 PBSZ 0
< 2014-10-27 10:25:32.040 200 PBSZ command successful.
> 2014-10-27 10:25:32.040 PROT P
< 2014-10-27 10:25:32.153 200 PROT command successful.
. 2014-10-27 10:25:32.173 Connected
. 2014-10-27 10:25:32.174 --------------------------------------------------------------------------
. 2014-10-27 10:25:32.174 Using FTP protocol.
. 2014-10-27 10:25:32.176 Doing startup conversation with host.
> 2014-10-27 10:25:32.228 PWD
< 2014-10-27 10:25:32.347 257 "/" is current directory.
. 2014-10-27 10:25:32.382 Changing directory to "\".
> 2014-10-27 10:25:32.382 CWD \
< 2014-10-27 10:25:32.476 250 CWD command successful.
. 2014-10-27 10:25:32.476 Getting current directory name.
> 2014-10-27 10:25:32.476 PWD
< 2014-10-27 10:25:32.557 257 "/" is current directory.
. 2014-10-27 10:25:32.737 Retrieving directory listing...
> 2014-10-27 10:25:32.738 TYPE A
< 2014-10-27 10:25:32.749 200 Type set to A.
> 2014-10-27 10:25:32.750 PASV
< 2014-10-27 10:25:32.804 227 Entering Passive Mode ().
> 2014-10-27 10:25:32.805 LIST -a

Reply with quote

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

There's nothing like $session.remotePath.

Anyway, is there any special character in your password?
I'm sending you a dev version of WinSCP to address you have used to register on this forum.

Reply with quote

malva
Joined:
Posts:
7

Could you send me .dll to 5.6.3 version?
You've sent me .dll to 5.5.6.0 version.


No matter what path I will add to:
$remotePath

log shows 'home' which is not correct path.

. 2014-11-03 15:10:38.827 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes

GUI log shows correct path:

. 2014-10-30 12:36:02.452 Local directory: C:\Users\xxxx\Documents, Remote directory: /test, Update: Yes, Cache: Yes

Reply with quote

Advertisement

malva
Joined:
Posts:
7

I tried with password without any special characters.
But error says straight:
530 User cannot log in, home directory inaccessible.

It's not user/password. It's remote directory which this script force to use 'home' instead any provided in $remotePath

Reply with quote

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

malva wrote:

I tried with password without any special characters.
But error says straight:
530 User cannot log in, home directory inaccessible.
But that's a different error than before. So the error changed when you used a password without special characters, right?

It's not user/password. It's remote directory which this script force to use 'home' instead any provided in $remotePath
You didn't show us your code. So we do not know what you refer to by $remotePath.

Could you send me .dll to 5.6.3 version?
You've sent me .dll to 5.5.6.0 version
No I did not. Please try to download the winscp20141031rmalvaautomation.zip again.

Reply with quote

malva
Joined:
Posts:
7

It was error 530 all the time.

Anyways it works now. In my IIS8 I deleted bindings for FTP server.
I have no idea if it's IIS8 problem or what, but with login like "hostname|user" it doesn't work (hostname added in bindings in IIS). With just "user" it works (without hostname in bindings in IIS).

And code is as follows if anybody needs:
Add-Type -Path "WinSCPnet.dll"
 
$sessionOptions = New-Object WinSCP.SessionOptions
$sessionOptions.Protocol = [WinSCP.Protocol]::Ftp
$sessionOptions.HostName = "ftp.com"
$sessionOptions.PortNumber = "990"
$sessionOptions.FtpSecure = "1"
$sessionOptions.SslHostCertificateFingerprint = "xxx"
$sessionOptions.UserName = "user"
$sessionOptions.Password = "pass"
 
$session = New-Object WinSCP.Session

Reply with quote

Advertisement

martin
Site Admin
martin avatar

malva wrote:

It was error 530 all the time.
Code is the same, but text has changed from "530 User cannot log in." to "530 User cannot log in, home directory inaccessible. "

Reply with quote

Advertisement

You can post new topics in this forum