Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 01-25-2012, 04:49 PM   #1
LQ Newbie
Registered: Jan 2012
Posts: 8

Rep: Reputation: Disabled
Is there a way to change ssh/sftp folders

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!
Old 01-25-2012, 05:20 PM   #2
Registered: Jul 2009
Posts: 619

Rep: Reputation: 42
Try editing /etc/passwd and changing the user home path to wherever you like.
Old 01-25-2012, 06:02 PM   #3
Registered: Oct 2011
Location: New Delhi
Posts: 229
Blog Entries: 3

Rep: Reputation: 17
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.


Last edited by pantdk; 01-25-2012 at 06:05 PM.
Old 01-26-2012, 12:16 PM   #4
Senior Member
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, Vsido, tinycore, Q4OS
Posts: 2,296

Rep: Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929
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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Restricting Users To SFTP Plus Setting Up Chrooted SSH/SFTP (Debian Squeeze) LXer Syndicated Linux News 0 09-06-2011 07:10 AM
SFTP on Linux Server - folders become world writable! Shawn.Dohmen@IsleDiscoun Linux - Server 1 01-21-2011 02:24 AM
Chroot SSH problem: ssh working, not SFTP & SCP. NaCo Linux - Security 3 02-01-2009 02:23 AM
change permissions of all folders and sub folders cad Linux - General 3 01-28-2007 10:21 AM
sftp and ssh kehkok Linux - Networking 4 09-20-2006 02:53 PM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:59 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration