Below are the steps I performed:
I created group sftponly.
Added one user named sftpusers to that group.
Added Subsystem sftp internal-sftp to file /etc/ssh/sshd_config
Added this line to the file /etc/ssh/sshd_config:
Match group sftponly
ChrootDirectory /home/sftpusers
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp
But the user is not restricted to the path /home/sftpusers. It is able to access directories of other users in /home. Is it possible to restrict user to a particular directory and not able to access other user directories in /home or any other path in unix.