设置默认的 ssh 密钥位置 [英] Setting the default ssh key location

查看:29
本文介绍了设置默认的 ssh 密钥位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ssh 将默认在 ~/.ssh 文件夹中查找其密钥.我想强制它总是在另一个位置寻找.

ssh will look for its keys by default in the ~/.ssh folder. I want to force it to always look in another location.

我使用的解决方法是将非标准位置的密钥添加到代理:

The workaround I'm using is to add the keys from the non-standard location to the agent:

ssh-agent
ssh-add /path/to/where/keys/really/are/id_rsa 

(在 Linux 上和 Windows 上的 MingW32 shell)

(on Linux and MingW32 shell on Windows)

推荐答案

如果您只想为您的身份文件指向不同的位置,您可以使用以下条目修改您的 ~/.ssh/config 文件:

If you are only looking to point to a different location for you identity file, the you can modify your ~/.ssh/config file with the following entry:

IdentityFile ~/.foo/identity

man ssh_config 查找其他配置选项.

这篇关于设置默认的 ssh 密钥位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆