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.

Is there anyway to set the password to be automatically trimmed on space at start/end when logging in via FTP?

I have found that a lot of my clients are having problems when copy/pasting the password.

share|improve this question
add comment

2 Answers 2

up vote 1 down vote accepted

VSFTPd is free software (licensed under GPL v2), so you can get the source and edit it yourself, to make the password-checking code white-space insensitive. Other than that, no, I'm not ware of any magic option to do that.

share|improve this answer
    
If I remember well, vsftp never see the passwords: they are only managed by PAM –  Gregory MOUSSAT Apr 24 '12 at 0:26
    
I'm not sure that is right; vsftpd's the code that's running, talking to the user. It may well invoke PAM to validate the credentials it collects, but it still has to collect them. –  MadHatter Apr 24 '12 at 6:03
    
You're right. vfsftp directly talk to the user, THEN deal with PAM. So the password can be filtered by vsftp. –  Gregory MOUSSAT Apr 24 '12 at 11:00
add comment

You can use a PAM module to filter user/password.
Either you find a module alerady available, either you have to build your own. Have a look at http://ftp.osuosl.org/pub/linux/libs/pam/Linux-PAM-html/Linux-PAM_ADG.html for building.

The PAM configuration for vsftp is into /etc/pam.d/vsftpd

Edit: I remember about pam_script.so
This PAM module allow you to run arbitrary command from PAM. So no need to develop something in C. Just use Bash to filter the password.
Similar need here: http://stackoverflow.com/questions/5284624/hook-into-linux-authentication-to-run-script-or-program-when-certain-conditions

share|improve this answer
add comment

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.