美文网首页
SSH远程登陆

SSH远程登陆

作者: treeQQ | 来源:发表于2019-07-30 15:52 被阅读0次

    本机需要配置多个ssh key

    本机需要配置多个ssh key时,可以生成不同文件名的key。然后在~/.ssh目录下添加名字为config的文件,为不同的主机指定不同的key

    # 主机一
    #Host github.com
    #Hostname github.com
    #User git
    #Identityfile ~/.ssh/github
    
    # 主机二
    Host xx.xx.xx.xx
    HostName xx.xx.xx.xx
    User xx
    IdentityFile ~/.ssh/xxx
    

    bash的四种模式

    参考链接 https://blog.csdn.net/whitehack/article/details/51705889

    ssh user@remote command 这种方式执行的commad命令属于第三种模式:interactive + non-login shell

    这种模式下,bash会找 ~/.bashrc文件,把里边的环境变量加载出来。

    相关文章

      网友评论

          本文标题:SSH远程登陆

          本文链接:https://www.haomeiwen.com/subject/corgrctx.html