Last active
December 27, 2015 15:29
-
-
Save nghuuphuoc/7348102 to your computer and use it in GitHub Desktop.
Setup chroot SFTP on Centos
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# See http://www.thegeekstuff.com/2012/03/chroot-sftp-setup/ | |
$ groupadd apl_devs | |
$ useradd -g apl_devs -d /var/www/sass -s /sbin/nologin apl_dev_sass | |
$ passwd apl_dev_sass | |
Changing password for user apl_dev_sass. | |
New password: | |
Retype new password: | |
passwd: all authentication tokens updated successfully. | |
# Verify | |
$ grep apl_dev_sass /etc/passwd | |
apl_dev_sass:x:500:500::/var/www/sass:/sbin/nologin | |
$ sudo nano /etc/ssh/sshd_config | |
#Subsystem sftp /usr/libexec/openssh/sftp-server | |
Subsystem sftp internal-sftp | |
$ chown -R apl_dev_sass:apl_devs /var/www/sass/path/to/particular/folder | |
$ service sshd restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment