LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-21-2012, 07:11 PM   #1
Vita
Member
 
Registered: May 2012
Distribution: Debian 6, CentOS 6
Posts: 39

Rep: Reputation: Disabled
How to create two users that share same dir plus vsftp access (Debian 6)?


Hi,

I have a problem I'm running Debian 6 and I need to have two users one that has the ability to login via ssh and the other that has only the ability to use FTP or to server as FTP user.
They need to share the same folder. The SSH users should have all permissions rwx, the FTP one should have only rw.

When I used CentOS 6.3 I was just running these commands and I got what I wanted but on Debian it does not work as it should. When FTP user tries to login to FTP server returns "530 Login incorrect" and refuses the connection.

Here are the commands that I use to create these users:
Code:
useradd SSHUser  
passwd SSHUser   #I set the password manually by typing
useradd FTPUser -d /home/SSHUser -s /sbin/nologin  #tried to change shell to /bin/false
passwd FTPUser #I set the pass for FTP user
usermod -a -G SSHUser FTPUser  #I set the FTP user to same group as SSHUser
chmod -R 775 /home/SSHUser #set the permissions to folder eaven tried with 777
So this works on CentOS 6.3 with vsftpd but it does not work with Debian 6.
Does anyone have a clue what is causing the problem?

Thanks in advance!

Last edited by Vita; 11-21-2012 at 07:13 PM.
 
Old 11-22-2012, 12:24 AM   #2
jsaravana87
Member
 
Registered: Aug 2011
Location: Chennai,India
Distribution: Redhat,Centos,Ubuntu,Dedian
Posts: 558
Blog Entries: 5

Rep: Reputation: Disabled
When FTP user tries to login to FTP server returns "530 Login incorrect" and refuses the connection.

1.What are the changes you had made in your vsftpd.conf file ?

If you had enabled Comment out pam_service_name=vsftpd in vsftpd.conf .Check out whether you could able to login

Last edited by jsaravana87; 11-22-2012 at 12:25 AM.
 
Old 11-22-2012, 12:29 AM   #3
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,643

Rep: Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539
Hi,

Make sure that /bin/false (and/or /usr/sbin/nologin) exist in /etc/shells.

Regards
 
Old 11-22-2012, 07:16 AM   #4
Vita
Member
 
Registered: May 2012
Distribution: Debian 6, CentOS 6
Posts: 39

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by arun5002 View Post
When FTP user tries to login to FTP server returns "530 Login incorrect" and refuses the connection.

1.What are the changes you had made in your vsftpd.conf file ?

If you had enabled Comment out pam_service_name=vsftpd in vsftpd.conf .Check out whether you could able to login
Here is my vsftpd.conf
Code:
listen=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
ftpd_banner=Welcome to blah FTP service.
chroot_local_user=YES
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/private/vsftpd.pem
Also I've tried with proftpd and no luck.

Quote:
Make sure that /bin/false (and/or /usr/sbin/nologin) exist in /etc/shells.
I've also tried with /bin/false ,they exist in the directory, that's not causing the problem.

More suggestions?

Thanks in advance!
 
Old 11-22-2012, 08:06 AM   #5
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,643

Rep: Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539Reputation: 1539
Quote:
I've also tried with /bin/false ,they exist in the directory, that's not causing the problem.
Open the file /etc/shells with your favorite text editor and add /bin/false after the other valid shells listed.
 
1 members found this post helpful.
Old 11-22-2012, 09:03 AM   #6
Vita
Member
 
Registered: May 2012
Distribution: Debian 6, CentOS 6
Posts: 39

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by bathory View Post
Open the file /etc/shells with your favorite text editor and add /bin/false after the other valid shells listed.
Thank you very much for help it worked!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Share Linux Dir and access through windows rajes4india General 5 04-12-2012 06:02 AM
[SOLVED] ftp multiple users should share a single folder/dir with their account passwords satyadev75 Linux - Server 4 02-07-2012 07:56 AM
Share access to single folder in user home dir? duffme Linux - Security 1 11-13-2011 11:29 PM
grp usr cannot gain access to share dir michaeltipton2222 Linux - Newbie 1 06-25-2007 07:40 PM


All times are GMT -5. The time now is 05:22 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration