nerdexam
CompTIA

XK0-005 · Question #643

A Linux administrator is configuring a two-node cluster and needs to be able to connect the nodes to each other using SSH keys from the root account. Which of the following commands will accomplish…

The correct answer is C. [root@nodea ~]# ssh-copy-id -i ~/.ssh/id_rsa root@nodeb. The ssh-copy-id command is used to copy a public SSH key from a local machine to a remote server and add it to the authorized_keys file, which allows passwordless authentication between the machines. The administrator can use this command to copy the root user's public key from…

System Management

Question

A Linux administrator is configuring a two-node cluster and needs to be able to connect the nodes to each other using SSH keys from the root account. Which of the following commands will accomplish this task?

Options

  • A[root@nodea ~]# ssh -i ~/.ssh/id_rsa root@nodeb
  • B[root@nodea ~]# scp -i ~/.ssh/id_rsa root@nodeb
  • C[root@nodea ~]# ssh-copy-id -i ~/.ssh/id_rsa root@nodeb
  • D[root@nodea ~]# ssh-agent -c ~/.ssh/id_rsa root@nodeb
  • E[root@nodea ~]# ssh-add -c ~/.ssh/id_rsa root@nodeb

How the community answered

(26 responses)
  • B
    15% (4)
  • C
    73% (19)
  • D
    8% (2)
  • E
    4% (1)

Explanation

The ssh-copy-id command is used to copy a public SSH key from a local machine to a remote server and add it to the authorized_keys file, which allows passwordless authentication between the machines. The administrator can use this command to copy the root user's public key from nodea to nodeb, and vice versa, to enable SSH access between the nodes without entering a password every time. For example: [root@nodea ~]# ssh-copy-id –i ~/.ssh/id_rsa root@nodeb. The ssh command is used to initiate an SSH connection to a remote server, but it does not copy any keys. The scp command is used to copy files securely between machines using SSH, but it does not add any keys to the authorized_keys file. The ssh-add command is used to add private keys to the SSH agent, which manages them for SSH authentication, but it does not copy any keys to a remote server.

Topics

#SSH keys#Passwordless authentication#Remote access#Linux administration

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice