change files permission on Remote machine

I would like to change permissions recursively on a remote folder.
Seems like sftp has a limitation, I am only able to change permission on a individual file..

sftp > chmod 777 /usr/local/apache/docs/test.txt

It would be great if someone has more knowledge on how this is doable recursively?

Try with rsh