LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-03-2010, 04:13 AM   #1
saran_redhat
Member
 
Registered: May 2009
Location: chennai
Posts: 247

Rep: Reputation: 16
Sftp server


Hi

I am configure one sftp server(openssh) in my linux server.
Its working fine. but when i try to connect its shows all folders like root, boot. but i need particular folder only. can anyone tel me how to do this.
I am using centos5.2
thanks

Last edited by saran_redhat; 12-03-2010 at 04:16 AM.
 
Old 12-03-2010, 07:16 AM   #2
redgoblin
Member
 
Registered: Jun 2005
Location: UK
Distribution: Debian
Posts: 189

Rep: Reputation: 41
OpenSSH supports the concept of chroot which can lock the user to a subdirectory. Have look in the man pages of sshd_config for more details.

Alternatively Google for sftp chroot centos for a few examples.
 
Old 12-03-2010, 07:43 AM   #3
go_tux_yourself
LQ Newbie
 
Registered: Oct 2009
Posts: 10

Rep: Reputation: 1
Re: SFTP users can see complete filesystem hierarchy

Hello saran_redhat,

Where do I begin with this question? First off, and please don't take offense to this but IMHO I would think that this question is a little advanced for being posted on a Newbie forum and would probably be better addressed under the Software forum. Although, the manner in which it was asked makes me waiver in my opinion on the matter as it is a somewhat more advanced question that was asked in a bit too much of a simple manner. You have stated that you have setup a sftp server on CentOS (I am presuming vsftp) and that everything is working accept user are able to see the root directory. Luckily, I have come across this problem before and I would like to help. The problem it that you have not given much information about your configuration, which leaves some questions that I can only presume the answers to for now. (Pertinent information would include uncommented lines in your vsftpd.conf $grep -v "^#" /etc/vsftp/vsftpd.conf ) For the sake of argument I will presume that you are wanting to setup a secured sftp server rather than a ftp or ftps server given by the fact you are mentioning Openssh as part of your configuration and the other two (ftp,ftps) do not use Openssh( I will retouch on this later). I will also presume that your configuration is disallowing anonymous login and thus using local account authentication. The last assumption I will make is that users are being chrooted after login ( If this is not the case then I would look into this as this is the prefered way to restrict access to parent directories outside of the chroot jail setup for the user). The issue with this is that chrooting for sftp on CentOS does not work properly as the version of Openssh supplied with CentOS does not support chrooting through ssh connections and therein lies the problem. Luckly there is a solution for this, and a few troubleshooting steps that I could suggest.

1. Is vsftp configured in the manner I have described? (local user authencation, chroot jail)
2. Check the version of Openssh. ($rpm -qa openssh) chrooting was not added until version 5.x
3. Does the chroot functionality work properly if you disable sftp in the vsftp configuration?

If these three steps are correct then you will likely need to install Openssh 5.x on your system. This leaves two options:
1) find a precomplied binary package for CentOS 5.2 (good luck, I have already checked dag weeirs and rpmforge with no such)
2) build your own rpm package using the following fantastic guide http://binblog.info/2009/02/27/packa...ssh-on-centos/ and while you're there checkout this article which discusses precisely this topic http://binblog.info/2008/04/06/opens...or-webhosting/

Hope this was helpful and as always,
go_tux_yourself

Last edited by go_tux_yourself; 12-03-2010 at 07:05 PM.
 
  


Reply



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
sftp server sang_froid Linux - Security 4 04-09-2009 05:37 PM
cannot login into SFTP server using Net::SFTP cccc Programming 1 10-31-2007 06:23 AM
sftp-server sopiaz57 Linux - Networking 10 01-05-2004 10:34 AM
Files truncated by sftp/sftp-server at 65kb gato Linux - Networking 1 12-18-2003 10:29 AM
Please help with sftp-server Jason_25 Linux - Networking 10 03-07-2003 04:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:43 AM.

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