Knowee
Questions
Features
Study Tools

Which of the following commands can be used to disable password-based authentication for an OpenSSH server on a Linux system, forcing all users to authenticate using an SSH key?Question 9Answera.sed -i 's/PasswordAuthentication yes/#PasswordAuthentication no/' /etc/ssh/sshd_configb.sed -i 's/#PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_configc.sed -i 's/#PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_configd.sed -i 's/PasswordAuthentication no/#PasswordAuthentication yes/' /etc/ssh/sshd_config

Question

Which of the following commands can be used to disable password-based authentication for an OpenSSH server on a Linux system, forcing all users to authenticate using an SSH key?Question 9Answera.sed -i 's/PasswordAuthentication yes/#PasswordAuthentication no/' /etc/ssh/sshd_configb.sed -i 's/#PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_configc.sed -i 's/#PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_configd.sed -i 's/PasswordAuthentication no/#PasswordAuthentication yes/' /etc/ssh/sshd_config

...expand
🧐 Not the exact question you are looking for?Go ask a question

Solution

The correct command to disable password-based authentication for an OpenSSH server on a Linux system, forcing all users to authenticate using an SSH key is:

b. sed -i 's/#PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config

This command uses the 'sed' (stream editor) to edit the sshd_config file in place (-i option). It searches for the line '#PasswordAuthentication yes' and replaces it with 'PasswordAuthentication no', effectively disabling password-based authentication.

This problem has been solved

Similar Questions

You aim to disable password-based authentication in SSH and only allow key-based authentication for added security. What configuration change is needed in the SSH server configuration file?1.0 Marks. Set KeyAuthentication only in /etc/ssh/sshd_configSet PasswordAuthentication no in /etc/ssh/sshd_configSet UsePAM no in /etc/ssh/sshd_config

Which of the following commands can be used to remove an SSH key from the ~/.ssh/authorized_keys file on a remote server, revoking access to the corresponding user?Question 3Answera.ssh-keygen -R user@remote_hostb.grep -v "ssh-.*user@remote_host" ~/.ssh/authorized_keys > ~/.ssh/authorized_keys.tmpc.ssh-keygen -f "~/.ssh/known_hosts" -R user@remote_hostd.sed -i '/^ssh-.*user@remote_host$/d' ~/.ssh/authorized_keys

Which of the following commands can be used to copy an SSH public key to a remote server, allowing the owner of the corresponding private key to log in without a password?Question 13Answera.ssh-copy-id user@remote_hostb.ssh user@remote_host "echo $(cat ~/.ssh/id_rsa.pub) >> ~/.ssh/authorized_keys"c.scp ~/.ssh/id_rsa.pub user@remote_host:~/.ssh/authorized_keysd.echo "$(cat ~/.ssh/id_rsa.pub)" | ssh user@remote_host "cat >> ~/.ssh/authorized_keys"

Please choose an appropriate answer.When hardening your SSH server, how can you disable root login?Set NoRootUser to yesSet PermitRootLogin to noSet PasswordAuthentication to noSet MaxAuthTries to 1

Which of the following commands can be used to verify the authenticity of an SSH public key, ensuring that it belongs to the expected user?Question 5Answera.ssh-keygen -lf ~/.ssh/id_rsa.pubb.ssh-keyscan user@remote_hostc.ssh-keygen -lf ~/.ssh/known_hostsd.ssh-keygen -lf ~/.ssh/authorized_keys

1/1

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.