服务器 Gind.cn

服务器问题集锦,包括 Linux(Ubuntu, Centos,Debian等)和Windows Server服务器

SSHconfiguration(〜/ .ssh / config) – 高级configuration

更新:只是为了确认更多关于我的设置,以防不清楚: 没有私钥在任何地方共享。 (1)使用Mac的人类程序员每个都有一个SSH密钥(在〜/ .ssh / id_rsa中),用于连接到我所有的BitBucket存储库(一个公司帐户)。 公钥元素被放置在BitBucket中授权他们,并批准所有我的BitBucket存储库的人。 (2)Ubuntu服务器每个都有自己的密钥对设置,并且每个BitBucket存储库都有一个SSH密钥。 每个公钥放在每个相应的BitBucket存储库中。 基本上我试图让一个composer.json文件(使用下面显示的URL格式)为人类和服务器工作(即当人类有一个SSH密钥访问我所有的BitBucket存储库(相同的帐户)当服务器有单独的SSH密钥访问每个BitBucket存储库时,他们被批准)。 – 我需要能够configuration我的〜/ .ssh / config文件来使用所有这些URLS: [email protected]:username/repository-abc.git [email protected]:username/repository-12345.git [email protected]:username/another-repo.git …但我不能使用别名。 所以我不能这样做: git@alias1:username/repository-abc.git git@alias2:username/repository-12345.git git@alias3:username/another-repo.git 原因是这些URL将存放在composer.json文件中,该文件也被本地开发计算机使用,这些计算机仅为所有BitBucket存储库使用一个SSH密钥,并且未configuration为了解所有不同的别名。 我可以configuration服务器,但是我在服务器上configuration了下面的〜/ .ssh / configconfiguration。 每当它尝试读取无效的私钥文件(例如,第二/第三回购将尝试首先读取第一个)时,它将失败。 但是,如果我select性地inputSSH密钥密码时,这可以工作,但是,如果密码不正确,忽略(只是按Enter键)。 Host bitbucket.org HostName bitbucket.org IdentityFile ~/.ssh/alias1_private_key Host bitbucket.org HostName bitbucket.org IdentityFile ~/.ssh/alias2_private_key Host bitbucket.org HostName bitbucket.org IdentityFile ~/.ssh/alias3_private_key configuration别名会很容易,但是由于开发计算机不理解,所以我被卡住了。 有没有办法做到这一点,以便它可以为一切工作? Host bitbucket.org HostName bitbucket.org Url […]