Skip to content

Commit

Permalink
ssh new sha accept
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiri Otoupal committed Sep 13, 2023
1 parent 3c147fd commit 13b99ec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion abst/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"CLI Command making OCI Bastion and kubernetes usage simple and fast"
)

__version__ = "2.0.6"
__version__ = "2.0.7"
__author__ = "Jiri Otoupal"
__author_email__ = "jiri-otoupal@ips-database.eu"
__license__ = "MIT"
Expand Down
6 changes: 4 additions & 2 deletions abst/bastion_support/oci_bastion.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,14 +220,16 @@ def run_ssh_tunnel_managed_session(self, bid, host, private_key_path, username,
print(f"Bastion {self.get_print_name()} initialized")
print(f"Initializing SSH Tunnel for {self.get_print_name()}")

ssh_tunnel_args = f'ssh -i {private_key_path} -o ServerAliveInterval=20 -o ProxyCommand="ssh -i {private_key_path} -W %h:%p -p {port} {bid}@{host} -A" -p {port} {username}@{ip} -A'
ssh_tunnel_args = (f'ssh -i {private_key_path} -o StrictHostKeyChecking=accept-new -o ServerAliveInterval=20 '
f'-o ProxyCommand="ssh -i {private_key_path} -W %h:%p -p {port} {bid}@{host} -A" -p {port} '
f'{username}@{ip} -A')
exit_code = self.__run_ssh_tunnel_call(ssh_tunnel_args, shell, already_split=True)
return ssh_tunnel_args, exit_code

def run_ssh_tunnel_port_forward(self, bid, host, ip, port, shell, local_port, ssh_pub_key_path):
print(f"Bastion {self.get_print_name()} initialized")
print(f"Initializing SSH Tunnel for {self.get_print_name()}")
ssh_tunnel_arg_str = f"ssh -o ServerAliveInterval=20 -N -L {local_port}:{ip}:{port} -p 22 {bid}@{host} -vvv -i {ssh_pub_key_path.strip('.pub')}"
ssh_tunnel_arg_str = f"ssh -o StrictHostKeyChecking=accept-new -o ServerAliveInterval=20 -N -L {local_port}:{ip}:{port} -p 22 {bid}@{host} -vvv -i {ssh_pub_key_path.strip('.pub')}"
self.__run_ssh_tunnel(ssh_tunnel_arg_str, shell)
return ssh_tunnel_arg_str

Expand Down

0 comments on commit 13b99ec

Please sign in to comment.