Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've setup VSFTPD so when a user connects it'll use a user_config_dir search for that connected user and setup a chroot guest session (since there are multiple FTP accounts belonging to multiple users on the server). This works fine with user names that have no special characters. To avoid collisions on usernames I'm setting up each username with a postfix '@domain.tld' - however, the custom rules in user_config_dir don't load when the user has an @ symbol in the name. Is there a way around this in VSFTPD - or a setting that needs to be switched?

vsftpd.conf

listen=YES
anonymous_enable=NO
local_enable=YES
guest_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
chroot_local_users=YES
pam_service_name=scftp
user_config_dir=/etc/vsftpd/virtual

pam.d/scftp

auth required /lib/security/pam_userdb.so db=/etc/vsftpd/vsftpd_login
account required /lib/security/pam_userdb.so db=/etc/vsftpd/vsftpd_login

vitrtual/usernamewithoutspecialchars

write_enable=YES
anon_mkdir_write_enable=YES
anon_other_write_enable=YES
anon_upload_enable=YES
local_root=/home/marco
chroot_local_user=YES
dirlist_enable=YES
download_enable=YES
guest_username=marco

virtual/user@domain.tld

write_enable=YES
anon_mkdir_write_enable=YES
anon_other_write_enable=YES
anon_upload_enable=YES
local_root=/home/marco
chroot_local_user=YES
dirlist_enable=YES
download_enable=YES
guest_username=marco

It really just seems it won't match the FTP user user@domain.tld to the proper virtual file - while usernamewithoutspecialchars works just fine.

share|improve this question
    
have you tried with \@ (escape) –  MealstroM Apr 20 '11 at 15:06
    
@MealstroM I have tried both user@domain.tld and user\@domain.tld as a file name. –  Marco Ceppi Apr 20 '11 at 16:17
    
hmm. try to put it in "" or '' –  MealstroM Apr 20 '11 at 16:20
    
@MealstroM You realize this is a file name, right? I can log in - it authenticates just not respecting the rules in the file I've setup for virtual user rules. –  Marco Ceppi Apr 20 '11 at 16:26

2 Answers 2

Linux filesystems can quite happily manage @ in the name of a directory so the problem you are seeing most likely is with vsftpd. Have you tried using user.domain.tld in stead of user@domain.tld?

share|improve this answer
    
Using a . has worked just fine. I've seen other services use @domain.tld before but I suppose they were using PureFTPD or another alternative. Guess this lands in the bug report land –  Marco Ceppi Apr 20 '11 at 16:37

You should try to use SQL or RADIUS backend for auth logins and usernames should be stored as emails in sql db . That works, ive tested it.

share|improve this answer
    
But how do I store custom attributes for it - Again it's not the auth, I can authenticate, it's loading custom rules that doesn't work for logins with @ in it. Even if I move the auth to SQL won't I still have the same issue? –  Marco Ceppi Apr 21 '11 at 12:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.