0
0

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 5 years have passed since last update.

公開鍵をワンライナーでクリップボードに持ってくる(Mac限定)

0
Last updated at Posted at 2020-07-07

pbcopyコマンドを使おう

公開鍵をサーバに持っていってログインで使うときに
リダイレクトミスを起こさないためにも Macをご利用の方は 以下をお使いくださいませ・・・

私のオススメ

パブリックキーを標準出力に表示して、パイプで クリップボードへ!
(less でもできたけど)

cat ~/.ssh/id_rsa.pub | pbcopy

一般的な方法

これでもできる。
しかし、不等号を逆にした場合、変なものを上書きしてしまうので危険が伴う

pbcopy < ~/.ssh/id_rsa.pub

おまけ

コピーした公開鍵は以下のコマンドで 追加してくださいな。

echo 公開鍵 >>authorized_keys
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?