8
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

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時に指定のディレクトリに移動してくれました。

8
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
8
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?