首页 > 其他 > 详细

ssh转发

时间:2019-12-10 20:39:53      阅读:101      评论:0      收藏:0      [点我收藏+]

ali-confluent-2

/user/hive/warehouse
/user/hive/warehouse/db_test1.db

yum install expect -y
cd /root
cd /root/.ssh/
vim config
Host oride-ops
HostName 152.32.140.150
Port 22
User root
IdentityFile ~/.ssh/uc2

vim uc2
私钥

mkdir .nat_rules/oride -p
vim oride-ops-mysql-13311
#!/bin/bash
L_PORT="13311"
R_HOST="10.52.80.112"
R_PRI_PORT="13305"
MON_PORT="0"
ALIAS="oride-ops"

VAR=$(expect -c "
spawn /usr/bin/autossh -M $MON_PORT -4 -C -L 0.0.0.0:$L_PORT:$R_HOST:$R_PRI_PORT -N $ALIAS
match_max 100000
expect \"$?assphrase*\"
send -- \"$PASS\r\"
send -- \"\r\"
expect eof
")
echo "======================="
echo "$VAR"
~

ssh转发

原文:https://www.cnblogs.com/hongfeng2019/p/12018867.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!