exam questions

Exam XK0-005 All Questions

View all questions & answers for the XK0-005 exam

Exam XK0-005 topic 1 question 86 discussion

Actual exam question from CompTIA's XK0-005
Question #: 86
Topic #: 1
[All XK0-005 Questions]

An administrator transferred a key for SSH authentication to a home directory on a remote server. The key file was moved to .ssh/authorized_keys location in order to establish SSH connection without a password. However, the SSH command still asked for the password. Given the following output:

Which of the following commands would resolve the issue?

  • A. restorecon .ssh/authorized_keys
  • B. ssh_keygen -t rsa -o .ssh/authorized_keys
  • C. chown root:root .ssh/authorized_keys
  • D. chmod 600 .ssh/authorized_keys
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
HappyDay030303
1 day, 19 hours ago
Selected Answer: D
file permissions on .ssh/authorized_keys must be restricted for SSH to accept it -rw-r--r-- the last r here means readable by others it is insecure so ssh ignores it
upvoted 1 times
...
e418137
8 months, 1 week ago
Selected Answer: A
(A) is most plausibly correct. A typical SELinux label for authorized_keys looks like this: 'unconfined_u:object_r:ssh_home_t:s0'. (B) There is no command, 'ssh_keygen'. (It's 'ssh-keygen'. (C) The file is owned by its user, not root. (D) The file, authorized_keys, works fine in 0600, 0640, and 0644. (But it's true that the best practice is 0600.)
upvoted 1 times
...
salrtom
12 months ago
D. chmod 600 .ssh/authorized_keys. It must have 600 permissions to work properly.
upvoted 2 times
...
LKRISB
1 year, 5 months ago
D. chmod 600 .ssh/authorized_keys This command sets the file permissions of .ssh/authorized_keys to 600, which means that only the owner (in this case, the user) will have read and write permissions, and no other users will have any permissions. By setting the correct permissions on the authorized_keys file, SSH will be able to use the key for authentication without asking for a password.
upvoted 2 times
...
linux_admin
1 year, 8 months ago
Selected Answer: A
"restorecon" is a command in SELinux (Security-Enhanced Linux) that is used to reset the security context of a file to its default SELinux security context. The "restorecon" command can be useful in cases where the SELinux security context of a file has been altered or changed, causing issues with the file's behavior or access. The "restorecon .ssh/authorized_keys" command specifically resets the security context of the "authorized_keys" file in the ".ssh" directory to its default SELinux security context. This can be useful in cases where the SELinux security context of the "authorized_keys" file has been altered, causing issues with SSH authentication.
upvoted 4 times
...
Ckl22
1 year, 9 months ago
Selected Answer: A
A does appear to be the correct method to restore the default context of a file
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago