Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Some users can ssh correctly, others don't. I have an admin user, which is in wheel. I used vsftpd for allowing FTP. I created a nologin user for FTP. Call this user "ftpuser". Now I want to allow sftp. It allows me to connect using admin user. I remove the nologin, by giving the user a shell via usermod -s /bin/bash ftpuser. It still doesn't allow me to connect from the ftpuser via sftp. The content of /home/ftpuser/.ssh is just the known_hosts file which contains "localhost" entry only.

User permissions are (in theory) ok:

ls -la /home
    working (admin)     : drwx------ 18 admin  admin 4096 Feb  6 15:33 admin
    non-working(ftpuser): drwx------  3 ftpuser ftp   4096 Mar 26 15:25 ftpuser

I haven't configured anything special on openssh. Does the ftpuser need anything extra than shell to enter via ssh?

share|improve this question
1  
What does /var/log/auth.log say about both users? –  Peter Meyer Mar 26 '12 at 17:01
    
Maybe a side note, but I think it's better practice to use FTPS with TLS. –  Lucas Kauffman Mar 26 '12 at 17:04
1  
Or /var/log/secure on RHEL/CentOS. –  cjc Mar 26 '12 at 17:06
    
@LucasKauffman Why do you think FTPS is better than SFTP/SCP? Considering the greater use of SSH/SFTP/SCP, better client support, more flexibility, and the advantage of all access being across a single port, I'd lean very heavily towards SFTP/SCP almost every time. About the only thing I think FTP is even remotely good for (encrypted or not) is for file distribution via anonymous FTP. –  Christopher Cashell Mar 26 '12 at 22:40

1 Answer 1

/var/log/auth.log will give you more details.

There are a few things that could be wrong. I'd start by checking the permissions on the /home/ftpuser/.ssh directory. OpenSSH may refuse to let you login if the permissions on that directory are incorrect (since malicious people could put public keys in there if you allow write access)

Try connecting with just ssh instead of sftp to see if it's a problem with sftp itself.

Also check your SSHd config file to see if there are restrictions on who is allowed to login. It may be limited to users in wheel.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.