rsync 排除git_在运行诸如Git,Rsync之类的Shell命令时如何指定Ssh键

rsync 排除git

rsync 排除git

I have a remote repository which is Git. I want to connect to Git over ssh because there are problems with the firewall rules in our work environment. How can use ssh to connect remotely to Git with specifying ssh keys for this Git operations.

我有一个远程存储库,它是Git。 我想通过ssh连接到Git,因为我们的工作环境中的防火墙规则存在问题。 如何通过ssh通过为此Git操作指定ssh密钥来远程连接到Git。

使用ssh-agent (Using  ssh-agent)

ssh-agent will create and temprorary environment where tkey is added with ssh-add command into the shell. After environment is completed git operations can be done where git will use current ssh keys to connect remotely with ssh tunnel. Keep in mind the keys will be lost after commands are completed

ssh-agent将创建一个临时环境,在该环境中,使用ssh-add命令将tkey添加到外壳中。 环境完成后,可以执行git操作,其中git将使用当前的ssh密钥与ssh隧道远程连接。 请记住,命令完成后按键会丢失

ssh-agent $(ssh-add /home/ismail/ssh_keys/ismail; \
 git clone [email protected]:ibaydan/dev.git)

使用主机配置 (With Host Configuration)

Another way to connect remote Git Repository over ssh is using ssh configuration files to specify IdentityFile like below

通过ssh连接远程Git存储库的另一种方法是使用ssh配置文件来指定IdentityFile,如下所示

Host github.com
    IdentityFile ~/.ssh/github_rsa

This will work too. When connecting to github.com specified IdentityFile will be used by ssh.

这也将起作用。 当连接到github.com时,ssh将使用IdentityFile

如何在运行Shell命令(如Git,Rsync Infografic)时指定Ssh键 (How To Specify Ssh Keys When Running Shell Command Like Git,Rsync Infografic)

How To Specify Ssh Keys When Running Shell Command Like Git,Rsync
How To Specify Ssh Keys When Running Shell Command Like Git,Rsync
在运行诸如Git,Rsync之类的Shell命令时如何指定Ssh键
LEARN MORE  Linux fuser Command Tutorial With Examples
了解更多Linux融合器命令教程和示例

翻译自: https://www.poftut.com/specify-ssh-keys-running-shell-command-like-gitrsync/

rsync 排除git

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值