LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 03-30-2016, 10:14 AM   #1
hero_xh
LQ Newbie
 
Registered: Mar 2016
Posts: 3

Rep: Reputation: Disabled
Centos 7 - SFTP, RSA-KEY and Chroot


Hi there,

I wish to set up a server as SFTP using RSA-KEY and Chroot.

My "/etc/ssh/sshd_config" file has the following configuration:

Quote:
Match Group sftp_group
X11Forwarding no
AllowTCPForwarding no
ChrootDirectory /var/www/html/XXX
ForceCommand internal-sftp
it is not working but if I modify the above for that it works:


Quote:
Match Group sftp_group
X11Forwarding no
AllowTCPForwarding no
ChrootDirectory /home
ForceCommand internal-sftp

So, my configuration is fine less this, it seems that if I change the ChrootDirectory for another different directory than /home doesn't work.

The user who try to sftp to /var/www/html/XXX has the right permission on /var/www/html/XXX.

Any suggestion?

Thanks
 
Old 04-01-2016, 07:20 AM   #2
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS, Manjaro
Posts: 5,695

Rep: Reputation: 2716Reputation: 2716Reputation: 2716Reputation: 2716Reputation: 2716Reputation: 2716Reputation: 2716Reputation: 2716Reputation: 2716Reputation: 2716Reputation: 2716
Check that documention

There are requirements for the ownership and permissions on the chroot home, AND THE FOLDER ABOVE IT, that need to be either met or explicitly disabled. I recommend meeting them, as there is no purpose in securing something and then adding a vulnerability for no reason.

I have set up chroot before using recent versions of OpenSSH, and have always been able to make it work. It IS picky, but then it is security software and SHOULD be!
 
Old 04-05-2016, 07:27 AM   #3
hero_xh
LQ Newbie
 
Registered: Mar 2016
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thanks for you answer!

I couldn't understand you really well to be honest...How can I enable the chroot for /var/www/html/XXX? it will be a risk although ....I would like to know how do it and afterwards choose :-)


Thanks!
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
chrooted sftp on centos 6.4 and public key auth garba Linux - Security 1 10-08-2013 12:52 PM
CentOS 6.3 sftp chroot jail CHIadam Linux - Security 21 02-27-2013 02:13 AM
SFTP logging for Chroot on CentOS 6.2 with openssh-5.3 not working (internal-sftp) RatherBFishin Linux - Server 1 08-30-2012 06:45 PM
Putty/SSH login failed when using RSA public key: 'Server refused our key' itsecx@gmail.com Linux - Server 10 10-04-2010 01:19 PM
OpenSSH 4.7+ chroot-ed SFTP and CentOS 5.3 iSpaZZZ^ Linux - Software 2 06-04-2010 09:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

All times are GMT -5. The time now is 07:00 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