FTP username logins in cPanel without the @ symbol or domain

A problem I’ve encountered which turned up not-too-much in Google is in creating ftp user accounts that just have a user name [name], as opposed to [name]@[domain.com]. Even though the latter is standard, the former is also very popular but is not officially supported on a standard cpanel installation. Many people say it’s not possible, but this is not the case. So how do you go about this?

First of all, you will need access to WHM on the server. From here, change the FTP Server from Pure-FTP to ProFTPD. This is a reasonably significant change and you should research the differences to be sure that you really want to go ahead with this. However, if you’re lucky, this may be all you need to do to swap it over. Keep reading if not.

The configuration file for ProFTPD should be found here: /etc/proftpd.conf . You may need to make changes, but back it up if you do. Make sure it has something along the lines of this at the top:

ServerName                      "ProFTPD"
AuthUserFile /etc/proftpd/[Your-CPanel-Account-Username]
ServerType                      standalone
DeferWelcome                    off
DefaultServer                   on
DefaultRoot ~ !wheel

 

Take note of the AuthUserFile — this is file is used for allowing users to log in. It stores the usernames and passwords (which are encrypted) along other information. Make sure this file exists as you’ve defined. If it doesn’t you may need to take the data from another file in that location.

I’ve not tested it, but I believe if you have more than one website hosted on the server, you can still do this so long if you use virtual host sections and specify individual port settings. In this case, add this to the bottom:

<VirtualHost [IP-Address-Here]>
        Port [Different-Custom-Port-Here]
        AuthUserFile /etc/proftpd/[Your-CPanel-Account-Username]
        DefaultRoot ~ !wheel
</VirtualHost>


 

Having made any changes, you need to restart the proftpd server that’s running. Use the following:


/etc/init.d/proftpd stop
/etc/init.d/proftpd start

Ftp usernames added via cpanel should now automatically work with the username as just [username], but at the expense of [username][@domain.net]. This may be all you need, but in my situation I had to maintain the old logins also. This meant editing the AuthUserFile that was defined in the proftpd.conf. Backup first, and using nano or vim, open the file to start editing. You will see the list of user names, an example of which is below:


testinglogin:$1$8tCKhugq$aCkrC/2k.xIHjFV9eCSgB/:500:501:[cpanel-account]:/home/[cpanel-account]/public_html/testinglogin:/bin/ftpsh

To re-eanble the old login, copy and paste the above line, which basically duplicates the settings including the password, but stick in your @domain.net manually, after the username but before the colon, like so:


testinglogin@your-domain.net:$1$8tCKhugq$aCkrC/2k.xIHjFV9eCSgB/:500:501:[cpanel-account]:/home/[cpanel-account]/public_html/testinglogin:/bin/ftpsh

Restart, again using /etc/init.d/proftpd stop and /etc/init.d/proftpd start. After this, you should test you are now able to log in with both.

Hope this helps!

Peter

 
 
I found these sources helpful when I was originally doing this myself:
http://forums.cpanel.net/f34/ftp-without-domain-com-25482.html (Chirpy’s post)
http://www.proftpd.org/docs/howto/ConfigFile.html