vsftp - local user auth

Hello everyone,

we have some SLES12 SP2 servers, which are integratet in AD domain.
For about two weeks its no possible to login with a local user by a ftp client.

vsftpd[13188]: pam_winbind(vsftpd:auth): request wbcLogonUser failed: WBC_ERR_AUTH_ERROR, PAM error: PAM_USER_UNKNOWN (10), NTSTATUS: NT_STATUS_NO_SUCH_USER, Error message was: No such user

The user exists and the passwort ist correct (really).
I’m able to login with the user by a ssh shell.

In my opinion the ftp server tries to authenticate the local user against the active directory.
But thats no correct and won’t work.

BR
Christian

Hi Christian,

For about two weeks its no possible to login with a local user by a ftp client.
the ftp server tries to authenticate the local user against the active directory.

have a look at the configuration files in /etc/pam.d, especially /etc/pam.d/vsftpd and /etc/pam.d/common-auth. Were these files recently changed, which might explain the change in behavior?

(it is possible to change the PAM service name in /etc/vsftpd.conf, see pam_service_name option there.)

By changing /etc/pam.d/vsftpd, you may configure to use a different authentication path for vsftpd than the general default. Or was the server configured the other way around, using local auth as a default and having a differing config for sshd? Anyhow, that’s where you can change to match your requirements…

Regards,
J

Hi J,

the date of last change is 7th April (vsftp) and 15th Mai (common-auth-pc).
The pam_service_name is vsftp.

I didn’t change something in /etc/pam.d/vsftp or /etc/vsftp.conf.
In /etc/security/pam_winbind I configured the require_membership_of to limit access to the server.

Regards,
Christian

Hi Christian,

does the current PAM configuration suggest that vsftpd should use locla users, while sshd should verify the credentials against the domain? Because the log message from you initial post clearly shows that PAM is validating the vsftp login against the domain, which I understood is not what you intended.

Regards,
J

How/Where can I check this?

Start with /etc/pam.d/vsftpd and follow the chain of “auth” entries. One of the modules will be “pam_winbind” (as per your initial message) to authenticate against your AD domain, while checks against the local users in /etc/passwd is done via pam_unix. See “man pam_unix” and “man pam_winbind” for details on these modules, and “man 8 pam” and the various sources on the net for a general description of PAM.

Regards,
J

In /etc/pam.d/vsftp is no pam_winbind. :confused:

[CODE]#%PAM-1.0

Uncomment this to achieve what used to be ftpd -A.

auth required pam_listfile.so item=user sense=allow file=/etc/ftpchroot onerr=fail

auth required pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed

Uncomment the following line for anonymous ftp.

#auth sufficient pam_ftp.so
auth required pam_shells.so
auth include common-auth
account include common-account
password include common-password
session required pam_loginuid.so
session include common-session[/CODE]

Hi Christian,

this is expected - follow the include chain (“auth include common-auth”) and you should see that module referenced.

[QUOTE=christianmolecki;38238][CODE]#%PAM-1.0

Uncomment this to achieve what used to be ftpd -A.

auth required pam_listfile.so item=user sense=allow file=/etc/ftpchroot onerr=fail

auth required pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed

Uncomment the following line for anonymous ftp.

#auth sufficient pam_ftp.so
auth required pam_shells.so
auth include common-auth
account include common-account
password include common-password
session required pam_loginuid.so
session include common-session[/CODE][/QUOTE]

Since you wrote that common-auth was last modified many weeks ago and the problem surfaced only recently, I’m rather curious how this did work at all. Maybe it wasn’t local users that were checked, but some AD account nevertheless? Introducing the group filter may then have broken that path to these accounts?

Regards,
J

So I compared the content of the files of /etc/pam.d/ between a SLES12 SP2 plain installation with a SLES12 SP2 current updates installation.

There are differences in common-account-pc, common-auth-pc, common-password-pc and common-session-pc.

If I replace the common-account-pc or the common-session-pc with the file from the plain installation, the login with local users works!

Differences common-account-pc

[CODE]
plain:
account required pam_unix.so try_first_pass

current updates:
account requisite pam_unix.so try_first_pass
account sufficient pam_localuser.so
account required pam_winbind.so use_first_pass
[/CODE]

common-session-pc

[CODE]
plain:
session required pam_limits.so
session required pam_unix.so try_first_pass
session optional pam_umask.so
session optional pam_systemd.so
session optional pam_gnome_keyring.so auto_start only_if=gdm,gdm-password,lxdm,lightdm
session optional pam_env.so

current updates:
session optional pam_mkhomedir.so
session required pam_limits.so
session required pam_unix.so try_first_pass
session required pam_winbind.so
session optional pam_umask.so
session optional pam_systemd.so
session optional pam_gnome_keyring.so auto_start only_if=gdm,gdm-password,lxdm,lightdm
session optional pam_env.so [/CODE]

BR
Christian

Hi Christian,

between a SLES12 SP2 plain installation with a SLES12 SP2 current updates installation

are both servers “AD-enabled”? Because the differences you show look like the result of activating AD integration (pam_winbind) and allowing creation of home dir on login (pam_mkhomedir).

pam_localuser, OTOH, looks like a manual addition. It will only check for the presence of a user in /etc/passwd and not by itself allow local users to log in.

How’s the actual authentication set up? Do you see pam_unix as a sufficient module in there, before winbind is invoked?

Regards,
J

[QUOTE=jmozdzen;38281]Hi Christian,

between a SLES12 SP2 plain installation with a SLES12 SP2 current updates installation

are both servers “AD-enabled”? Because the differences you show look like the result of activating AD integration (pam_winbind) and allowing creation of home dir on login (pam_mkhomedir).

pam_localuser, OTOH, looks like a manual addition. It will only check for the presence of a user in /etc/passwd and not by itself allow local users to log in.

How’s the actual authentication set up? Do you see pam_unix as a sufficient module in there, before winbind is invoked?

Regards,
J[/QUOTE]

The reason why local users can’t login, is the “require_membership_of” setting in /etc/security/pam_winbind.conf
Only these users/groups can login via ftp.

Is it possible to add a local user to this setting?

Christian

Or can I disable the check agains pam_winbind for ftp

Just found this post, as i am on the way to track down the same issue.
I do not have a fix for now, but a workaround.

Looks like vsftpd has some issues with pam_systemd.

As a workaround you can to disable pam_systemd.so for vsftpd

like …

grep ^[^#] /etc/pam.d/common-session >> /etc/pam.d/vsftpd sed -i -e 's/\\(.*pam_systemd.so.*\\)/#\\1/' -e 's/\\(.*common-session.*\\)/#\\1/' /etc/pam.d/vsftpd

In the meantime, we replaced ftp by more secure technologies.
So I can’t evaluate your workaround.

Thank you for updating this with your suggestion.