I tried to use SFTP using sudo to make changes in a file, following instruction:
Adding this line was a fix for me and comment the existing
subsystemline:
/etc/ssh/sshd_config:Subsystem sftp sudo -n true && sudo -n /usr/lib/openssh/sftp-server || /usr/lib/openssh/sftp-serversudo systemctl restart sshd
Now, I can't connect to the server at all, not via SFTP or SSH, and want to revert the change to be able to connect via SSH; how can I do this?
sudo systemctl restart sshdshouldn't have terminated your existing connection. Is the connection still alive? Or did you and can you log in directly without SSH? – Kamil Maciorowski Aug 25 '23 at 08:19sshd_config(or even with.bashrcor so), do not disconnect until you verify you are able to connect anew. Similarly (it's not your case though) when you play withsudoers, start a backup elevated shell and exit it only after making sure you can still usesudofrom a non-elevated shell. – Kamil Maciorowski Aug 25 '23 at 09:36