SFTP task i have made all the required steps but failed

SFTP task i have made all the required steps but failed. Can you please let me know the reason

steps followd:

1 useradd yousuf
2 passwd yousuf
3 mkdir -p /var/www/webapp/
4 chown yousuf:yousuf /var/www/webapp/
5 chmod 777 /var/www/webapp/
6 vi /etc/ssh/sshd_config
appended
Subsystem sftp internal-sftp
Match User yousuf
ForceCommand internal-sftp
PasswordAuthentication yes
ChrootDirectory /var/www/data
PermitTunnel no
AllowAgentForwarding no
AllowTcpForwarding no
X11Forwarding no

7 systemctl restart sshd

but not able to sftp, getting ERROR : - “user ‘yousuf’ was able to SSH into App Server 3, however user should only be allowed to make SFTP connection.”

@vishnu123sai seems like some permissions issue with ChrootDirectory directory, you should have verified the SSH and SFTP connections after making all the required changes.

Hi @Inderpreet, i thought same. thats why i have provided 777 permissions, still got same error. And one more thing i am able to ssh but not sftp