Configure SSH

$ yum install openssh-server openssl

$ cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak

$ vim /etc/ssh/sshd_config

Comment out the following line Subsystem SFTP/usr/libexec/openssh/SFTP server. –

Add the following lines at the end:

Subsystem sftp internal-sftp

Match Group sftp

ChrootDirectory /nsh/sftp/%u

ForceCommand internal-sftp

AllowTcpForwarding no

X11Forwarding no

Starting the SSH Service

$ systemctl start sshd

Create users and groups

$ mkdir -p /nsh/sftp/

$ groupadd sftp

$ useradd -m -d /nsh/sftp/nsh -g sftp -s /sbin/nologin nsh

$ passwd nsh

$ chmod -R 755 /nsh/sftp/

$ chown root:sftp /nsh/sftp/

$ chown root:sftp /nsh/sftp/nsh