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.

I'm running debian lenny - plesk. I want to create a new ftp user, so I run

useradd -d /var/www/vhosts/somedomain.com/httpdocs/somedir johnny

everything okay, johnny can now login, but he is able to see '/' instead of

/var/www/vhosts/somedomain.com/httpdocs/somedir

being his root dir.

Should I set his homedir somewhere else?

Another thing:

His shell is set to '/bin/sh' on the /etc/passwd file. If I change it to /bin/false he's not able to login anymore, wrong login error.

share|improve this question
    
You need to chroot your user. Are you talking about SSH or FTP? What is the name of your ftp server? –  Khaled May 7 '12 at 13:01
    
I dont need to give ssh access, just ftp, is 'useradd' the command I need to create an ftp user account and limiting it to '/var/www/vhosts/somedomain.com/httpdocs/somedir' ? –  Pedro May 7 '12 at 13:31
    
@Pedro: No, it isn't. –  womble May 7 '12 at 13:39
    
Is there are reason why you don't use Plesk to add the user? –  faker May 7 '12 at 13:49
    
I can't, dont have the option on the plesk panel for the domain. –  Pedro May 7 '12 at 14:52

1 Answer 1

Verify that you can access /var/www/vhosts/somedomain.com/httpdocs/somedir as the new user. If you can't, change the owner/permissions as appropriate.

His shell is set to '/bin/sh' on the /etc/passwd file. If I change it to /bin/false he's not able to login anymore, wrong login error.

Well, yes. That's the expected result. If you want the new user to run an application, but not a shell, then set the application as his shell in /etc/passwd.

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.