Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我希望每次登录到我的 Ubuntu 机器时都打开一个 ssh 隧道。.bashrc这似乎是错误的地方,因为我整个会话只需要一个隧道,而不是每个xterm. init.d似乎是错误的,因为我希望一个用户使用这个。.bash_profile仅用于 shell 登录(我认为),我也需要打开它以供 GUI 使用。 放置ssh打开隧道的命令的正确位置在哪里,以便我登录机器(GUI或shell)后它会在后台打开,并保持打开状态直到我注销?
.bashrc
xterm
init.d
.bash_profile
ssh
利用:
~/.bash_login or ~/.bash_profile or ~/.profile
在登录时运行命令和
~/.bash_logout
在注销时运行命令或终止进程。