Skip to content
This repository has been archived by the owner on Apr 6, 2021. It is now read-only.

Share a port, but not a shell #69

Open
probonopd opened this issue Dec 2, 2020 · 1 comment
Open

Share a port, but not a shell #69

probonopd opened this issue Dec 2, 2020 · 1 comment

Comments

@probonopd
Copy link

probonopd commented Dec 2, 2020

I would like to share a certain port of my machine via teleconsole (e.g., port 5900 a VNC server is running on), but not a shell.

The other party should be able to view my screen using VNC over the forwarded port, but not be able to log into a shell on my computer.

Is that doable?

@probonopd
Copy link
Author

probonopd commented Dec 2, 2020

With sshd one could do:

  PermitOpen 127.0.0.1:5900
  X11Forwarding no
  AllowAgentForwarding no
  ForceCommand /bin/false

When the user normally connects he will now be instantly disconnected because the /bin/false command will be triggered which does nothing but instantly exit with a code of 1. If you want to avoid this and keep your forwarding connection open, add the -N flag to the ssh command. This will not try to execute any command but still allows to setup TCP forwardings. (Source: https://unix.stackexchange.com/a/337445)

But with teleconsole?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant