1
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 1 year has passed since last update.

ssh鍵交換

Last updated at Posted at 2019-11-30

備忘録

[クライアント]
ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/schoolphoto/.ssh/id_rsa):【←そのままEnter】
Created directory '/home/ユーザー/.ssh'.
Enter passphrase (empty for no passphrase):【←そのままEnter】
Enter same passphrase again:【←そのままEnter】
Your identification has been saved in /home/ユーザー/.ssh/id_rsa.
Your public key has been saved in /home/ユーザー/.ssh/id_rsa.pub.
The key fingerprint is:
aa:zz:zz:dd:zz:ff:xx:xx:xx:xx・・・ ユーザー@xx.xx.xx
/home/ユーザー/.ssh/ に以下の2つのファイルが出来ていることを確認

[to リモート]
ssh-copy-id -i ~/.ssh/id_rsa.pub user@192.168.xx.xx

(exsiの場合 パスが違うので以下のようにcatで追記)
cat ~/.ssh/id_rsa.pub | ssh root@192.168.x.x "cat >> /etc/ssh/keys-root/authorized_keys"

(qnapの場合)
cat ~/.ssh/id_rsa.pub | ssh admin@192.168.x.x "cat >> /etc/config/ssh/authorized_keys"

(windows powershellからlinux)
cat ~/.ssh/id_rsa.pub | ssh USER@192.168.xx.xx "cat >> /home/USER/.ssh/authorized_keys"

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