I have nat and it has different servers. Therefore, from my local server I want to switch to nat, and then from nat I have to ssh to other machines
Local -> NAT (abcuser @publicIP with key 1) -> server1 (xyzuser @localIP with key 2) nat has a different ssh key and each server has a different ssh key how can I do this type of multihop ssh using fabric I tried to use the env function . roledefs , but it doesn’t seem to work either. I'm not sure how to define two ssh keys. I know that we can define a list of keys with env.key_filename, but the problem is checking each key with each server? How can I be more specific and map the key to one server only
I tried using the command from my local machine
fab deploy -g ' ec2-user@54.251.151.39 ' -i '/home/aman/Downloads/aws_oms.pem'
and my script
from __future__ import with_statement
from fabric.api import local, run, cd, env, execute
env.hosts=['ubuntu@10.0.0.77']
env.key_filename=['/home/ec2-user/varnish_cache.pem']
def deploy():
run("uname -a")
source
share