例如,每次我从我的mac开始:
ssh myself@192.168.100.101到linux服务器服务器和su oracle ,然后输入我的密码。 我希望通过使用一些别名来加速这个例程,这些别名同时执行ssh登录和su用户。
我知道ssh命令可以做远程命令行并退出。 但这不是我的要求:我不希望ssh登录/执行/返回,我希望它切换用户,我开始工作。
任何命令行选项可以帮助吗? 非常感谢。
E.g, each time I have start from my mac:
ssh myself@192.168.100.101 to a linux server server and su oracle, and type my password. I wish to accelerate this routine by using some alias, which do the ssh login and su user at the same time.
I know ssh command can do remote command line and quit. But that's not my requirement: I don't wish ssh login/execute/return, I want it to switch user and I start to work.
Any command line option could help on this? Thanks a lot.
最满意答案
ssh -t myself@192.168.100.101 "su oracle"-t
ssh -t myself@192.168.100.101 "su oracle"强制伪终端分配。 这可以用于在远程机器上执行任意基于屏幕的程序,这可以是非常有用的,例如在实现菜单服务时。 多个-t选项强制tty分配,即使ssh没有本地tty
-t
Force pseudo-terminal allocation. This can be used to execute arbitrary 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
更多推荐
发布评论