Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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

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 for building.

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

Edit: I remember about
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:

share|improve this answer

Your Answer


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.