Which of the following commands will allow the user to upload the public key to a remote server and enable passwordless login?

A user generated a pair of private-public keys on a workstation.

Which of the following commands will allow the user to upload the public key to a remote server and enable passwordless login?
A . scp ~/.ssh/id_rsa user@server:~/
B . rsync ~ /.ssh/ user@server:~/
C . ssh-add user server
D . ssh-copy-id user@server

Answer: D

Explanation:

The command ssh-copy-id user@server will allow the user to upload the public key to a remote server and enable passwordless login. The ssh-copy-id command is a tool for copying the public key to a remote server and appending it to the authorized_keys file, which is used for public key authentication. The command will also set the appropriate permissions on the remote server to ensure the security of the key. The command ssh-copy-id user@server will copy the public key of the user to the server and allow the user to log in without a password. This is the correct command to use for this task. The other options are incorrect because they either do not copy the public key (scp, rsync, or ssh-add) or do not use the correct syntax (scp ~/.ssh/id_rsa user@server:~/ instead of scp ~/.ssh/id_rsa.pub user@server:~/ or rsync ~ /.ssh/ user@server:~/ instead of rsync ~/.ssh/id_rsa.pub user@server:~/).

References: CompTIA Linux+ (XK0-005)

Certification Study Guide, Chapter 13: Managing Network Services, page 410.

Latest XK0-005 Dumps Valid Version with 136 Q&As

Latest And Valid Q&A | Instant Download | Once Fail, Full Refund

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments