Score:0

How to edit /etc/ssh/sshd_config file on linux?

cn flag

My VM has only ssh Kay authentication method but i want to enable password authentication too. For that, i want to edit /etc/ssh/sshd_config file and add PasswordAuthentication yes but it doesn't allow me to edit and returns: permission denied. Then i tried to enable edit on this file with: chmod 744 /etc/ssh/sshd_config But for that i get some result too : Permission denied.

What can i do?

hr flag
Does this answer your question? [How do I get permissions to edit system configuration files?](https://askubuntu.com/questions/92379/how-do-i-get-permissions-to-edit-system-configuration-files)
NotTheDr01ds avatar
vn flag
Hello and Welcome to Ask Ubuntu. Just a heads-up that I removed the [tag:windows-subsystem-for-linux] tag since I'm fairly confident, given your question, that you aren't using Windows Subsystem for Linux. WSL is a Windows 10 (and later) feature that allows you to run Linux distributions such as Ubuntu under Windows. It sounds like you are using a virtual machine in Windows, which isn't the same thing. If I'm wrong about this, please edit your question, re-add the tag, and add more details about your configuration. Thanks!
waltinator avatar
it flag
If you have `$EDITOR` and `$VISUAL` set to the path of your editor, you can `sudoedit /etc/ssh/sshd_config`. Don't mess with permissions/ownerships having to do with SSH - it's very picky about them (with good reasons) and will refuse to function if they're "wrong". Read `man sudoedit`.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.