1
2

More than 5 years have passed since last update.

SSH先に設定を持っていく sshrc コマンド

Last updated at Posted at 2019-07-14

こんにちは。ドミノ(@dr3mms)です。
SSH 先の設定をサーバごとに変えたいなーと思ったら sshrc コマンドが使えそうだったので、
さわりだけですがまとめました。
細かい設定ができたら追記していきます。

ダウンロード

以下のファイルをダウンロード して PATH の通ったディレクトリに配置する
https://raw.githubusercontent.com/Russell91/sshrc/master/sshrc

権限を変更する

chmod +x sshrc

C:\Windows\System32 に配置した場合
image.png


設定ファイルを作成する

echo "echo 'test'" >~/.sshrc

ログイン後に test を表示するだけです

接続する

ssh コマンドのかわりに sshrc コマンドで接続する
image.png

~/.ssh/config ファイルの host 名でも接続可能
image.png


参考

sshrc: ssh時に.bashrc設定等をssh先に持っていけるコマンド
sshした先に.bashrcや.vimrcを持って行きたい人のためのsshrc - Qiita

1
2
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
1
2