Our previous web server was Windows based, and it hosted multiple domains. As a result, if a user with name "username" wanted to log in via FTP to "example.com", they'd provide their username as "[email protected]".
We've modified things since then; our web server is now using CentOS 6, and our app no longer relies on FTP for anything. However, there may still be some stragglers out there who haven't updated, and I was curious if it's possible to set up some FTP users to emulate the old behavior, sort of as a little backwards compatibility until we know that no one's relying on it anymore. Trying to create a user with an '@' in their name results in the somewhat predictable:
useradd: invalid user name '[email protected]'
It's probably not possible to coerce the system to accept a name like that, but I don't know if there's any system for something like those "virtual domains" when users log in that's anything similar to what we were doing on Windows.
As you're using proftpd then you should be able to do this by creating virtual users and then using the ftpasswd program to create your usernames.
which puts
into the AuthUserfile
FTP users on CentOS can include the
@
symbol in usernames depending entirely on the daemon that is serving FTP. For example, Midnight Commander allows the@
symbol in usernames if the option is properly enabled in a.netrc
file. In some FTP daemons, the@
symbol is allowed in a username if the connection string replaces the@
with a plus sign.HERP DERP
This isn't a problem with proftp, this is an issue with the username not being acceptable to
useradd
. DO not useuseradd
, usevipw
instead to edit your passwd file and user the username with an2
symbol. FTP does not have it's own userbase, but rather uses the/etc/passwd
file's user list.Some notes on usernames being added with
useradd
:Furthermore, usernames have to begin with an alphanumeric character.