LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Is there a way to change ssh/sftp folders (https://www.linuxquestions.org/questions/linux-server-73/is-there-a-way-to-change-ssh-sftp-folders-925710/)

FancY_Hat 01-25-2012 04:49 PM

Is there a way to change ssh/sftp folders
 
hello!
I have recently set up a CentOS file server, and I'm trying to limit my users' access in ssh and sftp, to non-OS related files. I have set up my file server so that CentOS runs on a small HDD, and my File server all my publicly available files are on one, large HDD. what I'm trying to do is limit my users who ssh and sftp in, to my second drive. by default, ssh and FTP bring users to /home/*user*/. I'm trying to make it so that when they ssh in it by default brings them to /media/*file server*/
Ideally, I'd like to keep all user files inside the OS drive, and all their navigation inside the File sever; but the latter is the more important so, if I can't have the best of both worlds, I'll settle for that. any help is appreciated! thanks in advance!

cbtshare 01-25-2012 05:20 PM

Try editing /etc/passwd and changing the user home path to wherever you like.

pantdk 01-25-2012 06:02 PM

As i understand your requirement is the ftp user didn't list any other directory or didn't move from their respective directory
then u have uncomment the line of chroot enable in vsftpd & the make a chroot file which restrict the user from listing or move from the define directory they just work on their define directory.

chroot_list_enable=YES
chroot_list_file=/etc/vsftpd/chroot_list

wpeckham 01-26-2012 12:16 PM

If your user use it
 
The more recent OpenSSH packages have options to restrict SFTP, SCP, and SSH sessions into a chroot-like environment in their home without the overhead of using chroot. Combined with the vsftp advice above, you should be able to safely restrict those accounts from seeing or transferring system files.


All times are GMT -5. The time now is 02:50 PM.