Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #16  
Old 30th January 2012, 06:17 PM
david m Offline
Registered User
 
Join Date: Jan 2012
Location: Spain
Posts: 9
linuxfirefox
Re: how to enable local user on localhost vsftpd?

But disabling SELinux protection for individual daemons is possible, or so it should:
http://docs.fedoraproject.org/en-US/...-securitylevel
Reply With Quote
  #17  
Old 30th January 2012, 06:37 PM
jpollard Offline
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,150
linuxfedorafirefox
Re: how to enable local user on localhost vsftpd?

Nope. What that entry is referring to is disabling SELinux. You might note that the entry doesn't give any boolean flag name to use...

You can define additional local policies, and give those defined labels to daemons....

But they are still operating under SELinux rules.

Unless you are very familiar with what SELinux is doing, creating such policies will usually result in a more insecure system.
Reply With Quote
  #18  
Old 4th March 2012, 01:21 AM
Annorax64 Offline
Registered User
 
Join Date: Mar 2012
Location: NC, USA
Posts: 3
macosfirefox
Re: how to enable local user on localhost vsftpd?

I had the same issue, and I had to set the following SEBool entries:
# setsebool ftp_home_dir on
# setsebool allow_ftpd_full_access on
Additionally, I had to add the following to vsftpd.conf:
check_shell=NO

I also added the following to /etc/shells (but not sure this is necessary or not):
/bin/bash
Hope it helps!
Reply With Quote
  #19  
Old 4th March 2012, 01:10 PM
jpollard Offline
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,150
linuxfirefox
Re: how to enable local user on localhost vsftpd?

Well... adding the /bin/bash would/should have eliminated the need for "check_shell=NO", and using the "check_shell=NO" would have eliminated the need to add bash to the /etc/shells.

Missing /bin/bash from the file /etc/shells is a known bug. It is supposed to be there.

The advantage of checking shells prevents an odd hacking attack where a user account has a shell that does strange things. It hasn't happened in a long time.
Reply With Quote
  #20  
Old 5th March 2012, 12:59 AM
Annorax64 Offline
Registered User
 
Join Date: Mar 2012
Location: NC, USA
Posts: 3
macosfirefox
Re: how to enable local user on localhost vsftpd?

Thanks for the explanation. I was wondering if that was the case, so I added the little disclaimer to the second item. I agree that check_shells should probably be put back in again and I will.

Thanks!
Reply With Quote
  #21  
Old 11th April 2013, 03:21 PM
vsftpdhelp Offline
Registered User
 
Join Date: Apr 2013
Location: PARIS
Posts: 3
linuxubuntufirefox
Lightbulb Re: how to enable local user on localhost vsftpd?

Had the same problem, finally figuring out the solution

I had in the passwd file (/etc/passwd) the shell (information after last colon) set to /bin/true, which was not in /etc/shells.
It appears that vsftpd check that the user is existing and have permission to log-on (with a valid shell) and that was my problem.

I did that way, to not let /bin/sh because of the risk user can log in using SSH (or telnet).

Code:
# grep myuser /etc/passwd
myuser:x:1001:1001:FTP user,,,,Upload file:/usr/local/custom:/bin/true
# grep /bin/true /etc/shells
#
Adding /bin/true to the valid list of shell's command in /etc/shells resolved my situation.
Maybe it's not /bin/true for you, you migth want to check the shell is in the /etc/shells also, and if no, to insert it.

The solution above will let you have an user with ftp permission but no shell permission.
Reply With Quote
  #22  
Old 11th April 2013, 05:15 PM
jpollard Offline
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,150
linuxfirefox
Re: how to enable local user on localhost vsftpd?

Actually, it lets the user login, but because /bin/true exits immediately, the user is also logged out.

You should get a record of each login as a valid login.
Reply With Quote
  #23  
Old 11th April 2013, 05:32 PM
vsftpdhelp Offline
Registered User
 
Join Date: Apr 2013
Location: PARIS
Posts: 3
linuxubuntufirefox
Re: how to enable local user on localhost vsftpd?

I don't think /bin/true get ever executed. In fact if i remove it from /etc/shells i got :

Thu Apr 11 18:29:41 2013 [pid 30943] [myuser] FAIL LOGIN: Client "127.0.0.1"
and as FTP code
530 Login incorrect.

Otherwise i got
Thu Apr 11 18:30:14 2013 [pid 30957] [myuser] OK LOGIN: Client "127.0.0.1"
and FTP code
230 Login successful.

SSH or telnet would execute it, because it's aims to be interactive, not ftpd

Last edited by vsftpdhelp; 11th April 2013 at 08:29 PM.
Reply With Quote
  #24  
Old 11th April 2013, 06:29 PM
jpollard Offline
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,150
linuxfirefox
Re: how to enable local user on localhost vsftpd?

ftpd includes its own command interpreter - all it looks for is a valid shell...and not "nologin".
Reply With Quote
  #25  
Old 11th April 2013, 07:25 PM
vsftpdhelp Offline
Registered User
 
Join Date: Apr 2013
Location: PARIS
Posts: 3
linuxfirefox
Re: how to enable local user on localhost vsftpd?

To conclude, as mentionned previously, i ran into the same issue that check_shell is done for :

Quote:
check_shell
Note! This option only has an effect for non-PAM builds of vsftpd. If disabled, vsftpd will not check /etc/shells for a valid user shell for local logins.

Default: YES
taken from https://security.appspot.com/vsftpd/vsftpd_conf.html

But because I tried with check_shell=NO in my vsftpd.conf, without success, and that would be the proper solution, i let my system hack of adding my "/bin/true" (or whatever is your shell command in /etc/passwd file) into /etc/shells
I should say i don't have any SELinux system as discussed previously so that wasn't the issue here.



Note:
The shell command associated with the user has no purpose to be executed. As you said previously, it would generate potentially bad behaviour of triggering execution from a ftp log-on, whereas you have no way to execute shell command from FTP connection.
I gave it a try and it's not executed (replaced /bin/true with a logger).
Quote:
Originally Posted by jpollard View Post
Actually, it lets the user login, but because /bin/true exits immediately, the user is also logged out.
As for technical details, I checked the code source. My results state that inside vsf_sysdep_check_auth() called from handle_local_login() (from file privops.c, use for local login obviously), you can see how it is evaluated.
getpwnam(user).pw_shell (reading the member's shell in /etc/passwd) is not executed but is compared against libc's getusershell() (which is reading the content of /etc/shells). The shell path is not used anywhere else in the source code.

Last edited by vsftpdhelp; 11th April 2013 at 08:49 PM.
Reply With Quote
Reply

Tags
authentication problem, can't log in, enable, fedora, ftp, local, localhost, user, vsftpd

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I set up a local domain to (www.localhost.loc) to redirect to a file in my OS TheCodah Servers & Networking 2 15th March 2011 10:00 PM
vsftpd +local users chowell Servers & Networking 2 17th March 2007 02:08 AM
enable authentication for vsftpd cuongvt Servers & Networking 21 29th September 2006 09:30 AM
vsftpd local user permissions BrandonV Using Fedora 3 22nd August 2005 06:04 PM
vsftpd local user login denied upsco2002 Using Fedora 5 1st July 2005 05:08 AM


Current GMT-time: 00:33 (Thursday, 20-06-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat