LoginSignup
34
27

More than 5 years have passed since last update.

sshの接続を省略する方法

Last updated at Posted at 2013-03-14

~/.ssh/configファイルに設定することで省略できます。

config
# hogeサーバー
Host hoge
    HostName example.com
    Port 22
    User test
    IdentityFile ~/.ssh/id_rsa

このように設定すると

$ ssh test@example.com

普通このように書くのが

$ ssh hoge

とするだけで接続できるようになります。
Hostの部分は接続の時に使う分かりやすい名前をつけます!

他にscpやrsyncでも同じ設定を使うことができるので

$ scp index.html hoge:~/www/

みたいに書くことができます!
configにはたくさん設定できるので試してみてください!

34
27
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
34
27