LoginSignup
7
6

More than 3 years have passed since last update.

指定のディレクトリに一発で移動するssh configの書き方

Posted at

sshした際、必ずhomeでカレントディレクトリが開始することになると思いますが、
毎回同じ場所にcdしないといけないのが面倒なのでssh configに設定してみました。

Host project1_ssh
    HostName api2.project1.com
    User amasok
    Port 2222
    RemoteCommand cd /var/source/current/; $SHELL -il # ←これと
    RequestTTY yes # ←これ

こんな感じでやったらssh時に指定のディレクトリに移動してくれました。

7
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
6