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 have a question about copssh configuration. I want to change the home directory when a user logs in via SFTP but when I change the directory in the /etc/passwd file, I am no longer able to login with my RSA key. I have blocked password authentication and when I leave the root path /home/username I am able to access SFTP and SSH just fine with my private key.

I hope I have included everything. Thanks in advance for the help!

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Have you copied the directory /home/username/.ssh to the new home directory? It's easy to miss as it's a hidden folder.

share|improve this answer
    
Thanks! That was exactly it! I just have a few more questions though. The .ssh is hidden in the directory, but still shows up on the FTP tree. Is there anyway I can prevent that? Also, how do I block access to the cygdrive when the user logs in? I just want them to be able to traverse down the tree, not up. Thanks again! –  Siriss Jan 21 '11 at 0:24
    
The FTP tree is displayed by the FTP client - there might be an option in the settings to display this. As for the traversing, you want to chroot them. Google for chroot and the name of your FTP server and you will hopefully find something. chrooting SSH is a bit more difficult unless you're on a newer version of SSH than 4.3p2 - it's still possible on older versions but it's easy to break something so I'd recommend against trying it unless you're very comfortable with Linux. I'm not sure what cygdrive or copssh are, so if I'm beating the wrong bush apologies :) –  James Lawrie Jan 21 '11 at 0:30
    
Thanks again for the help! copssh is an OpenSSH implementation for Windows. cygdrive is the root (like My Computer), so for example in copssh if I wanted to set the directory to the root of the C: drive, I would use 'cygdrive/c' as the path. I will look into chrooting. Thank you! –  Siriss Jan 21 '11 at 0:46

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.