kk Blog —— 通用基础


date [-d @int|str] [+%s|"+%F %T"]
netstat -ltunp
sar -n DEV 1

linux下设置 git ssh 代理

https://blog.csdn.net/chuoleibizhiz6357/article/details/101061719

安装connect-proxy,也可以使用linux自带nc命令

rpm文件下载

1
2
3
http://rpm.pbone.net/index.php3?stat=3&search=connect-proxy&srodzaj=3

$ sudo rpm -ivh connect-proxy-1.93-2.el6.i686.rpm

添加~/.ssh/config

1
2
3
4
5
6
7
8
9
10
11
$ vim ~/.ssh/config (没有则新建文件),添加

Host git.oschina.net *.oschina.net

ProxyCommand connect-proxy -H 192.168.60.34:18608 %h %p 或

#ProxyCommand /usr/bin/nc -X connect -x 192.168.60.34:18608 %h %p

IdentityFile ~/.ssh/id_rsa

User caiwang213@qq.com

说明:ProxyCommand可以用linux自带/usr/bin/nc命令,参考man 5 ssh_config

1
2
3
4
5
6
7
8
9
ProxyCommand /usr/bin/nc -X connect -x 192.168.60.34:18608 %h %p # Redhat7.3不可行

$ chmod 600 /home/caiwang213/.ssh/config,不然会提示:

[caiwang213@caiwang213 ~]$ ssh -v -T git@git.oschina.net 

OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013

Bad owner or permissions on /home/caiwang213/.ssh/config

tools, git

« IPMI share 端口 nc 命令 »