GNU/Linux >> Linux の 問題 >  >> Linux

パスワードなしでRHEL7サーバーにSSHログイン

RHEL7 Linuxサーバーにログインするには、最初にサーバーとクライアントマシン間で公開鍵を交換する必要があります。これを行うには、ssh-copy-idを使用できます 指図。

$ ssh-copy-id user@rhel-server
The authenticity of host 'rhel-server (rhel-server)' can't be established.
ECDSA key fingerprint is 21:4d:71:f6:ef:1f:c1:f7:a9:d9:81:4d:9d:34:4d:a9.
Are you sure you want to continue connecting (yes/no)? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
user@rhel-server's password: 

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh 'user@rhel-server'"
and check to make sure that only the key(s) you wanted were added.

上記のコマンドは、リモートサーバーへのアクセスが認証され、パスワードが交換されるためのパスワードを入力します。次のようなエラーメッセージが表示された場合:

/usr/bin/ssh-copy-id: ERROR: No identities found

まず、以下のコマンドを使用してsshキーを生成する必要があります:

$ ssh-keygen 
Generating public/private rsa key pair.
Enter file in which to save the key (/home/user/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/user/.ssh/id_rsa.
Your public key has been saved in /home/user/.ssh/id_rsa.pub.
The key fingerprint is:
2a:2b:8b:c3:10:2c:0e:8a:7e:bf:0d:2c:fa:31:dc:99 [email protected]
The key's randomart image is:
+--[ RSA 2048]----+
|                 |
|                 |
|.                |
|+.               |
|*.      S        |
|+.. o o.         |
|+  =.E.          |
|.+o.+oo          |
|.o++oo..         |
+-----------------+

完了したら、上記のssh-copy-idを試してください もう一度コマンドします。


Linux
  1. パスワードなしでSSHログインを設定する方法

  2. パスワードレスログインSSH– CentOS 6 / RHEL 6

  3. CentOS/RHEL で「パスワードレス」SSH ログイン用の SSH キーをセットアップする方法

  1. パスワードでSSHログインを無効にする方法

  2. ssh-keygen と ssh-copy-id を使用してパスワードなしで SSH ログインを実行する 3 つの手順

  3. SSH ログインが遅いのはなぜですか?

  1. SSH2 から OpenSSH にパスワードなしで SSH および SCP を実行する方法

  2. .bashrc をソースにしない SSH

  3. パスワードなしのキーを使用して SSH ログインが機能しませんか?