我有以下命令:
ssh -Y \
ubuntu@ec2-doop.us-west-1.compute.amazonaws.com \
-i "$HOME/.interos/pem/latest/interos-test.pem"
AWS_ACCESS_KEY_ID=xxxx \
AWS_SECRET_ACCESS_KEY=xxx exec /bin/bash
当我echo "$AWS_SECRET_ACCESS_KEY"
时,我得到了空变量。如何通过命令行传递这些变量?还是仅从本地计算机上的文件中获取vars?
我也尝试过使用它:
'export AWS_ACCESS_KEY_ID=AKIA5JN65TLJSSBQKGVX export AWS_SECRET_ACCESS_KEY=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 exec /bin/bash'
那也不起作用
答案 0 :(得分:1)
尝试一下
ssh -Y \
ubuntu@ec2-doop.us-west-1.compute.amazonaws.com \
-i "$HOME/.interos/pem/latest/interos-test.pem" \
'export AWS_ACCESS_KEY_ID=xxxx && \
export AWS_SECRET_ACCESS_KEY=xxx && \
exec /bin/bash'