• Add User with No Login 

[root@testsvr01 ~]# useradd  -s /sbin/nologin -p password user

  • Modify sshd_config File 

[root@testsvr01 ~]# vi  /etc/ssh/sshd_config

    #Subsystem      sftp    /usr/libexec/openssh/sftp-server   

   Subsystem sftp internal-sftp

   Match Group user
   ForceCommand internal-sftp
   ChrootDirectory /home/user
   X11Forwarding no
   AllowTcpForwarding no

  • Restart SSHD Service  

root@testsvr01 ~]#   systemctl restart sshd
 

 

Technology