要在 ssh 连接上执行的脚本

Ole*_*leg 1 scripting linux ssh

有一个远程主机,每次我通过 ssh 连接到它时,我都想在那里运行一个特定的脚本。我应该把要自动运行的文件放在哪里?

Cak*_*mox 5

从 ssh 手册页:

~/.ssh/rc
         Commands in this file are executed by ssh
         when the user logs in, just before the user's
         shell (or command) is started.  See the
         sshd(8) manual page for more information.
Run Code Online (Sandbox Code Playgroud)