问题原文
原帖链接 · Maximilian Ebel · CC BY-SA 4.0
I have a docker container which bind the port 2222:22. It's possible to connect using ssh -T sub.example.com -p 2222.
I'm looking for a way to access ssh the container without specify the port number. I thought this could be done with a DNS record.
I set a DNS record SRV _ssh._tcp.sub 5 10022 sub.example.com to my domain in the admin interface of my provider, this does not work.
Is there a way to do that?
社区高分解答
原帖链接 · Tomek · CC BY-SA 4.0
I am using wrapsrv together with ProxyCommand and socat to use SRV records for determination of connection endpoint:
Host *.my.domain
ProxyCommand wrapsrv _ssh._tcp.%h socat STDIO TCP:%%h:%%p
The advantage is that both scp and sftp should use it from ssh config file.
Please note that SRV record needs THREE integers: priority, weight and port, not two as you are showing in your question.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
