domain-name-system – 在调用ssh之前将主机名扩展为fqdn?

domain-name-system – 在调用ssh之前将主机名扩展为fqdn?,第1张

概述我使用.ssh / config文件根据子域的给定部分适当地设置我的用户名,例如: Host *widgetshop.com* User foobar ControlMaster auto ControlPath ~/.ssh/socket-%r@%h:%pHost * ControlMaster auto ControlPath ~/.ssh/socket-%r 我使用.ssh / config文件根据子域的给定部分适当地设置我的用户名,例如:
Host *Widgetshop.com*   User foobar   ControlMaster auto   ControlPath ~/.ssh/socket-%r@%h:%pHost *   ControlMaster auto   ControlPath ~/.ssh/socket-%r@%h:%p

这有效,如果我写:

ssh foo.Widgetshop.com

但是如果我写的话就行不通:

ssh foo

在搜索路径分辨率变为相同的fqdn.

任何人都有办法在调用ssh或其他方法之前扩展短名称?

解决方法 也许您可以使用host命令:
ssh $(host -t A  foo | cut -f1 -d" ")

把它放入shell脚本(用“$1”替换“foo”)和exec ssh.

总结

以上是内存溢出为你收集整理的domain-name-system – 在调用ssh之前将主机名扩展为fqdn?全部内容,希望文章能够帮你解决domain-name-system – 在调用ssh之前将主机名扩展为fqdn?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1131581.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-30
下一篇2022-05-30

发表评论

登录后才能评论

评论列表(0条)

    保存