Skip to content

Commit

Permalink
open ssh tunnel from ssh/config
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroTochigi committed Jun 20, 2024
1 parent 1e8f675 commit e016f6e
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
6 changes: 4 additions & 2 deletions src/aws/dependencies/reverseShell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,11 @@ function openSSHTunnel(){
ssh -i /root/.ssh/$sshkey root@$instanceIp 'screen -m -d bash -c "service ssh restart"'
sleep 2

treehouses sshtunnel add host "$monitorPort" root@"$instanceIp"
#treehouses sshtunnel add host "$monitorPort" root@"$instanceIp"
#deleteUnusedSShtunnel $instanceIp $sshtunnelPortArray
openNonDefaultSShtunnel $instanceIp $sshtunnelPortArray
#openNonDefaultSShtunnel $instanceIp $sshtunnelPortArray
createSshConfig "myserver" $instanceIp "user" "22" "~/.ssh/id_rsa" "8888:80,9999:443"
autossh -f -T -N -q -4 -M 2200 myserver

echo "Below sshtunnels are configured"
treehouses sshtunnel ports
Expand Down
2 changes: 1 addition & 1 deletion src/aws/driver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function awsDriver() {
installAwsCli "${@:2}"
;;
test)
testConfigDriver
testConfigDriver "${@:2}"
;;
*)
echo "Error: Invalid command."
Expand Down
3 changes: 1 addition & 2 deletions src/aws/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,7 @@ function init {
isOpen=$(waitForOutput "ssh-keyscan -H $publicIp | grep ecdsa-sha2-nistp256")
echo "Opened ssh tunnel"

updateOrAppend $instanceName $publicIp
openSSHTunnel $instanceName $portConfigArray
openSSHTunnel $publicIp $portConfigArray

storeConfigIntoTreehousesConfigAsStringfiedJson $instanceName $keyName $instanceId $publicIp $groupName
}
Expand Down
1 change: 0 additions & 1 deletion src/aws/restart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,4 @@ function restart(){
echo "the new ip address is $publicIp"
updateIPAddress $balloonName $publicIp

updateOrAppend $instanceName $publicIp
}
4 changes: 2 additions & 2 deletions src/utils/dependencies/config.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#CONFIG=~/.ssh/config
CONFIG=~/Projects/luftballon/config # Test
CONFIG=~/.ssh/config
#CONFIG=~/Projects/luftballon/config # Test

0 comments on commit e016f6e

Please sign in to comment.