LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-04-2024, 10:19 AM   #1
LinuxUser2
LQ Newbie
 
Registered: Feb 2024
Posts: 6

Rep: Reputation: 0
ftp user login not working


Hello,

I have created multiple users that do not have the ability to login to the bash shell but should be able to login to ftp sessions.

I have an older RHEL 7.2 server that is set up identical to our new RHEL 8.7 server, the users and home directories and permissions etc are all identical. (as far as I am aware)

I have even created a new additional testuser just to confirm this is not working for any of the created users. I am not sure if there is some new security implementation on RHEL 8.7 that is preventing this or what. Any suggestions would be greatly appreciated.


Example of CLI I/O below:

[root@hostname~]# useradd -d /file/path/Testuser -s /dev/null testuser
[root@hostname~]# passwd testuser
Changing password for user testuser.
New password:
BAD PASSWORD: The password is shorter than 8 characters
Retype new password:
passwd: all authentication tokens updated successfully.


Attempt to test ftp session logon ability:

[root@hostname ~]# ftp hostname
Connected to hostname (xxx.xx.xxx.xx).
220 (vsFTPd 3.0.3)
Name (hostname:root): testuser
331 Please specify the password.
Password:
530 Login incorrect.
Login failed.

The password is 100% for certain being entered correctly but also was flagged as "BAD PASSWORD" but allowed me to complete the commands and they seemed to be accepted and applied.

/etc/passwd entry for testuser

testuser:x:1009:1009::/file/path/Testuser:/dev/null
 
Old 03-04-2024, 10:27 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,483

Rep: Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556
Quote:
Originally Posted by LinuxUser2 View Post
Hello,

I have created multiple users that do not have the ability to login to the bash shell but should be able to login to ftp sessions.

I have an older RHEL 7.2 server that is set up identical to our new RHEL 8.7 server, the users and home directories and permissions etc are all identical. (as far as I am aware)

I have even created a new additional testuser just to confirm this is not working for any of the created users. I am not sure if there is some new security implementation on RHEL 8.7 that is preventing this or what. Any suggestions would be greatly appreciated.


Example of CLI I/O below:

[root@hostname~]# useradd -d /file/path/Testuser -s /dev/null testuser
[root@hostname~]# passwd testuser
Changing password for user testuser.
New password:
BAD PASSWORD: The password is shorter than 8 characters
Retype new password:
passwd: all authentication tokens updated successfully.


Attempt to test ftp session logon ability:

[root@hostname ~]# ftp hostname
Connected to hostname (xxx.xx.xxx.xx).
220 (vsFTPd 3.0.3)
Name (hostname:root): testuser
331 Please specify the password.
Password:
530 Login incorrect.
Login failed.

The password is 100% for certain being entered correctly but also was flagged as "BAD PASSWORD" but allowed me to complete the commands and they seemed to be accepted and applied.

/etc/passwd entry for testuser

testuser:x:1009:1009::/file/path/Testuser:/dev/null
So what other logs have you checked?
 
Old 03-04-2024, 10:34 AM   #3
LinuxUser2
LQ Newbie
 
Registered: Feb 2024
Posts: 6

Original Poster
Rep: Reputation: 0
Not many, any specific logs you would suggest checking?

Thank you.
 
Old 03-04-2024, 10:36 AM   #4
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,483

Rep: Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556
Quote:
Originally Posted by LinuxUser2 View Post
Not many, any specific logs you would suggest checking?

Thank you.
If you don't know where ftp and authentication logs are then just look at everything in /var/log
 
Old 03-04-2024, 11:12 AM   #5
LinuxUser2
LQ Newbie
 
Registered: Feb 2024
Posts: 6

Original Poster
Rep: Reputation: 0
was not able to find anything relating to vsftpd in /var/log

journalctl | grep vsftpd

Mar 04 12:09:33 vsftpd[229080]: pam_winbind(vsftpd:auth): getting password (0x00000380)
Mar 04 12:09:33 vsftpd[229080]: 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: The specified account does not exist.
Mar 04 12:09:33 vsftpd[229080]: pam_winbind(vsftpd:auth): getting password (0x00000390)
Mar 04 12:09:33 vsftpd[229080]: pam_winbind(vsftpd:auth): pam_get_item returned a password
Mar 04 12:09:33 vsftpd[229080]: 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: The specified account does not exist.

Makes no sense to me how the error can be that the account does not exist when it most definitely does.
 
Old 03-04-2024, 11:16 AM   #6
jayjwa
Member
 
Registered: Jul 2003
Location: NY
Distribution: Slackware, Termux
Posts: 792

Rep: Reputation: 252Reputation: 252Reputation: 252
Proftpd can use passwd maps that are not the system passwd file (similar to Apache's basic auth). You might want to look at that, or anonymous login. I'm guessing the config won't just let any user you make up login willy-nilly, so probably you'll have to change the config file as well. It's like that in proftpd (which is what I'm familiar with).
 
Old 03-04-2024, 11:17 AM   #7
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS, Manjaro
Posts: 5,697

Rep: Reputation: 2717Reputation: 2717Reputation: 2717Reputation: 2717Reputation: 2717Reputation: 2717Reputation: 2717Reputation: 2717Reputation: 2717Reputation: 2717Reputation: 2717
Have you examined the VSFTP documentation on creating and authenticating virtual accounts? you do not need an OS account at all, if they are only getting FTP access.

PS: you can do this for SFTP access in the SSHD configuration if you want to support SFTP directly, but that DOES require a real OS account.

I have done both, but a decade or more ago and I have not had coffee yet today....
 
1 members found this post helpful.
Old 03-04-2024, 11:31 AM   #8
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 2,816

Rep: Reputation: 1210Reputation: 1210Reputation: 1210Reputation: 1210Reputation: 1210Reputation: 1210Reputation: 1210Reputation: 1210Reputation: 1210
A login shell /dev/null might prevent from all system access.
Change it to /sbin/nologin

Some ftpd versions also require /sbin/nologin in /etc/shells

Last edited by MadeInGermany; 03-04-2024 at 11:39 AM.
 
Old 03-04-2024, 11:39 AM   #9
lvm_
Member
 
Registered: Jul 2020
Posts: 958

Rep: Reputation: 340Reputation: 340Reputation: 340Reputation: 340
Quote:
Originally Posted by LinuxUser2 View Post
080]: pam_winbind(vsftpd:auth): request wbcLogonUser failed: WBC_ERR_AUTH_ERROR, PAM error: PAM_USER_UNKNOWN (10), NTSTATUS: NT_STATUS_NO_SUCH_USER,
Looks like it looks for AD user, not a local one. What pam_service_name is configured for vsftpd?
 
1 members found this post helpful.
Old 03-04-2024, 12:46 PM   #10
LinuxUser2
LQ Newbie
 
Registered: Feb 2024
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks for all the responses guys.

I figured it out with the assistance of ChatGPT, using the Journalctl | grep vsftpd

ChatGPT identified based on the log output that the vsftpd service was using Pluggable Authentication Modules (PAM) and winbind to authenticate.

Checking the PAM config file for vsftpd located at: nano /etc/pam.d/vsftpd

commented out these two lines

auth required pam_unix.so
account required pam_unix.so


systemctl restart vsftpd


Boom like magic it works.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
when I use ftp://user@ftp.blah.com it works. But when I type just ftp.blah.com says.. hunterhunter Linux - General 15 03-05-2014 09:12 AM
rpm not working from root login but working from user login amar.sree Linux - Newbie 2 08-09-2012 08:53 PM
local ftp login OK - remote ftp login failure bluethundr Linux - Newbie 3 08-24-2011 11:13 AM
how to create sftp user only in red hat 4 not ftp user ..only sftp user princeu28 Linux - Newbie 1 10-14-2008 08:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration