答案1
我认为这就是你想要的,在你.bashrc
或.bash_profile
alias cmdname="ssh -t [email protected] ssh application.server.com"
从man ssh
:
-t Force pseudo-tty allocation. This can be used to execute arbi-
trary screen-based programs on a remote machine, which can be
very useful, e.g., when implementing menu services. Multiple -t
options force tty allocation, even if ssh has no local tty.
获取文件以获取新别名:
source .bashrc [OR] source .bash_profile
现在从终端测试一下:
[user]# cmdname
如果您还没有,我还会设置 ssh-keys,这样您就不需要输入任何密码。您只需输入命令即可自动登录。