There are some times that one needs to setup a read-only user to your SSH/sFTP host. To do that lets first login via SSH to your vps/server.
Once connected all we need to do is edit one file, the /etc/ssh/sshd_config ** Follow my initial setup here.
Once the above is done, lets take that user you created and set the user to read only. To do that we just add two lines to our config file.
An sftp user or group can be restricted to read-only access by using the “internal-sftp -R” option.
After a successful configuration, the sftp user or group will only have read-only access.
Here is an example of an entry in sshd_config file to restrict “user1” to read-only access for sftp:
Match User user1
ForceCommand internal-sftp -R
Here is an example of an entry in sshd_config file to restrict “testgrp” to read-only access for sftp:
Match Group testgrp
ForceCommand internal-sftp -R
