私信发送成功
Watch Star Fork

sohunjug / connect.shShell

暂无描述
克隆/下载
sohunjug 最后提交于 2016-08-08 16:56 finish
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
2016-08-08 16:56
2016-08-08 16:33
Loading...
README.md 1.15 KB

使用connect.sh自动连接ssh或者telnet

其中配置文件conn.profile为json格式

配置样例:

{
   "test1": {
       "host": "192.168.0.1",
       "port": 22,
       "user": "root",
       "pass": "123456",
       "connecttype": "ssh",
       "sshtype": "pass",
       "language": "None"
   },
   "test2": {
       "host": "192.168.0.1",
       "port": 22,
       "user": "root",
       "pass": "123456",
       "connecttype": "ssh",
       "sshtype": "~/.ssh/test_rsa",
       "language": "en_US.UTF-8"
   },
   "test3": {
       "host": "192.168.0.1",
       "port": 23,
       "user": "root",
       "pass": "123456",
       "connecttype": "telnet",
       "language": "en_US.UTF-8"
   }
}

可以自定义设置别名

echo 'aliases="$HOME/Documents/ssh/connect.sh"' >> ~/.bashrc

之后执行

connect show test1

/test1/host           	192.168.0.1
/test1/port           	22
/test1/user           	root
/test1/pass           	123456
/test1/connecttype    	ssh
/test1/sshtype        	pass
/test1/language       	en_US.UTF-8

connect test1

Last login: Mon Aug  8 23:48:46 2016 from gateway
[root@clusterA31 ~]#

项目点评 ( 0 )

你可以在登录后,对此项目发表评论

4_float_left_people 4_float_left_close