Username in the address for an FTP site

6

1

I have set up a number of an FTP sites using IIS7.5. The sites use hostnames to differentiate between them. One drawback of using hostnames is that you have to pass the address of the ftp site into the username e.g.

Ftp Address: ftp://ftp.example.com

Username: ftp.example.com|User1

Password: psswrd

I would like to at least pass in the username as part of the connection address e.g. ftp://ftp.example.com|User1@ftp.example.com but I have been unable to do this using Windows Explorer (in Windows 7). Whenever I try this technique I'm still prompted to enter the user name and password.

I have set the useDomainNameAsHostName=True on the server which allows a bit more flexibility in the username but I still can’t get it to work. Neither ftp://ftp.example.com%5CUser1@ftp.example.com/ or ftp://User1%40ftp.example.com@ftp.example.com/ seems to make any difference in IE9 or Chrome.

Where am I going wrong?

SausageFingers

Posted 2011-11-29T12:30:02.247

Reputation: 177

Is there a reason why you can't simply use: ftp://username:password@domain.tld ? – iglvzx – 2011-12-03T00:23:59.133

Yeah, it isn't working, hence my question. I'm using windows 7 and a collecting to ftp via windows explorer. Passing the username in the format you suggested just prompts me with a login dialog which doesn't have the user name populated. My main goal is to be able to pass around a connection string so that all the client has to do is enter the password. – SausageFingers – 2011-12-05T11:43:32.207

Answers

5

Working with IIS 7.5 is a bit daunting when it comes to the new virtual hostnames for FTP servers. However, even though it seems you have configured yoru IIS 7.5 server correctly, IE, Chrome, and other browsers to not know how to handle those type of virtual host requests in the same manner that your IIS 7.5 can handle it.

The only work around currently available is to do the following, quoted:

Internet Explorer, Windows Explorer and Virtual FTP Sites issue

Both the Internet Explorer and Windows Explorer first try to connect to FTP server anonymously. If they fail, then they prompt for credentials.When FTP 7 is only configured with virtual host name based sites, these clients fail. Anonymous logon will be be rejected by server the way, that is valid as far as FTP specification (RFC 959) goes, nonetheless, it confuses the authentication sequence of those clients. Robert McMurray, noticed the problem long time ago and proposed a simple workaround in the following blog http://blogs.msdn.com/robert_mcmurray/archive/2008/12/17/ftp-clients-part-3-creating-a-global-listener-ftp-site.aspx.

To address the problem, you would need to create a GlobalListenerFtpSite, that is not configured with a host name. It has to deny anonymous access. As a matter of fact you should not allow any access to the site (leave the authorization section empty). This site will reject the anonymous logon the way that is friendly to IE and Windows Explore. Everything will then work as expected. Robert's blog entry will provide more information on the topic.

You can find out much more in-depth information from the following article and write up: Addressing the “|” separator problem for virtual FTP Sites (FTP 7.5).

zackrspv

Posted 2011-11-29T12:30:02.247

Reputation: 1 826

4

I don't really understand what the real error is.

You should connect using ftp://username:password@domain.tld. The fact that you think that you need to pass the domain in your username doesn't make any sense to me.

But in your example you use the | in your username and your browser will try and change that to something with %. I think you should check the error logs and get back on that.

Metalmini

Posted 2011-11-29T12:30:02.247

Reputation: 61

1

Passing only the username will not work the way you want it to, i.e. having to enter only the password after that. When you send the URL as

ftp://user@host:port

The server will try to authenticate you without any password, but as it will fail, the server will ask for the username and password again. So you have to enter them both again in the dialog box that appears.

I tried in Chrome. The username is wiped from the URL even before pinging the server. Firefox won't even load the page and Opera, using its inbuilt FTP manager, says authentication failure and asks for both username and password.

Bibhas

Posted 2011-11-29T12:30:02.247

Reputation: 2 490

0

Ideally, the format you are looking for is ftp://user@website.

However, the results of using such an address depend on the client browser and not on the web-server.

Firefox will do exactly what you ask for, prompting only for the password.
Internet Explorer will ignore the specified user and ask for both.

harrymc

Posted 2011-11-29T12:30:02.247

Reputation: 306 093