So I've added a public key to authorized_keys. How can I limit it so that it may forward ports but it may not have a shell?
|
feedback
|
|
You have to put a
(This is all in a single line, I added the line breaks for readability). UPDATE: if you want to prevent remote command execution you have to add:
| |||||||||||
feedback
|
Section AUTHORIZED_KEYS FILE FORMAT. You can restrict what users can port forward to simply by adding the ports and hosts you want to allow, like
Also you can restrict where do the user connect from, which commands can execute, etc. | |||
|
feedback
|
|
I would look at using scponly, I suspect it can be used for port forwarding rather than scp/sftp-only access. It is intended to restrict the user from logging in or executing commands via ssh. The other factor you may need to, or want to, use sshd in a chroot'ed environment, here are some instructions on setting up sftp using chroot. You should be able to adapt them fairly easily. I hope that helps you find your solution. | |||
|
feedback
|