LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to create two users that share same dir plus vsftp access (Debian 6)? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-create-two-users-that-share-same-dir-plus-vsftp-access-debian-6-a-4175438205/)

Vita 11-21-2012 07:11 PM

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!

jsaravana87 11-22-2012 12:24 AM

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

bathory 11-22-2012 12:29 AM

Hi,

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

Regards

Vita 11-22-2012 07:16 AM

Quote:

Originally Posted by arun5002 (Post 4834518)
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!

bathory 11-22-2012 08:06 AM

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.

Vita 11-22-2012 09:03 AM

Quote:

Originally Posted by bathory (Post 4834801)
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!


All times are GMT -5. The time now is 05:36 PM.