Quantcast
Channel: Spiceworks Community - Latest topics
Viewing all articles
Browse latest Browse all 188897

SFTP CHROOT access to centos

$
0
0

I'm trying to setup SFTP access to a file server as we need to share files with clients over the internet and I have no faith in plain FTP.

For now password authentication is fine but I would also like to use certificate authentication later.

I installed centos 6.3 and did the following:

# yum -y install openssh-server openssh-clients
# chkconfig sshd on
# service sshd start
# netstat -tulpn | grep :22

# vi /etc/ssh/sshd_config

Replace
Subsystem sftp /usr/local/libexec/sftp-server
by
Subsystem sftp internal-sftp

# vi /etc/ssh/sshd_config

Match group sftponly
ChrootDirectory /home/%u
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp

# groupadd sftponly

# mkdir /home/test
# useradd -g sftponly test
# usermod -d / test
# passwd test
# chown test /home/test
# chmod 760 test

Now I can SFTP in as root and "standard user" but I get "server unexpectedly closed connection" errors when attempting access via the "test" user.

Does anyone know what I have missed? I would really like to get this working on CentOS and stay away from MS as I'm trying to learn more about using Linux for as much as possible.

ps. tried turning off SELINUX but made no difference so I turned it back on again


Viewing all articles
Browse latest Browse all 188897

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>