LoginSignup
8
7

More than 5 years have passed since last update.

ssh接続のデフォルトユーザを設定して作業効率を上げる方法

Last updated at Posted at 2015-12-10

概要

ssh時にLDAP等の認証が必要になる場合毎回以下のようにユーザ名を入力していましたが、
デフォルトでユーザ名を設定しておいた方が楽だろうという事に気付き最近設定しました。

ssh yourname@192.168.x.x
ssh 192.168.x.x -l yourname

方法

~/.ssh/configの設定でUserの設定をするだけです。
以下は全てのhostに対してyournameで認証する場合の例になります。

Host *
User yourname

これをしておく事でssh時にユーザ名を入れずに済みます。

※.sshと.ssh/configのファイルの権限を適切にしないと反映されないので注意してください。

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