Score:-2

How I can edit etc folder with sudo user

cn flag

So I gave sudo privileges to a user and I turned off root login. Now I want to edit some server configs in etc folder, but I have no permission. I can't edit the config file to turn on login to root user. What I should do?

I am using Ubuntu 20. I added sudo to user by running adduser user1 and usermod -aG sudo user1 and made keys for that user to log in without password.

Then I disabled root login and authentication in sshd_config file and give permissions to user1 with sudo chown -R user1:user1 /home/user1 and chmod 700/user1/.ssh ,but when I try to edit server files with user1 I have no permissions and if I give permissions to server files for user1 I break root sudo and get in trouble. So user1 never gets full privileges.

hr flag
Please [edit] your question to show **how** you tried to edit the file(s), and the exact error message
Score:1
in flag

Often on my local or when work on other computer(s) use SSH to login, then do my editing with nano.

GNU nano is a small and friendly text editor. It aims to emulate
the Pico text editor while also offering a few enhancements.

Believe is recommended for SSH to NOT enable root access from other machines, rather USERs login as themselves then use SUDO when required for root permission on other machines.

.

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.