【问题标题】:Is it possible to define mutiple Hosts in SSH Config File?是否可以在 SSH 配置文件中定义多个主机?
【发布时间】:2013-09-06 03:54:07
【问题描述】:

我是新手。我不知道是否有人问过这个问题。我正在为 Windows 使用 CYGWIN。我已经为我的一个站点创建了一个快捷方式,以使 SSH 变得简单,并且一切正常。我做了以下

Host shortcut    
  HostName hostname.com
  User ubuntu    
  IdentityFile "~/.ssh/path-to-file.pem"

现在我想在另一个网站上做这件事,因为输入我的大主机名很麻烦。是否可以在同一个config 文件中定义?还是应该在新文件中完成?还是不可能?

【问题讨论】:

    标签: windows amazon-web-services ssh cygwin config


    【解决方案1】:

    可以在同一个config中定义。它看起来像下面的例子

    Host shortcut
      HostName hostname.com
      User ubuntu
      IdentityFile ~/.ssh/path-to-file.pem
    
    Host shortcut2
      HostName hostname2.com
      User ubuntu
      IdentityFile ~/.ssh/path-to-file2.pem
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-01-09
      • 2013-09-02
      • 2020-07-11
      相关资源
      最近更新 更多