Answer the question
In order to leave comments, you need to log in
How to make sudo authorization with ssh key?
The bottom line is:
Answer the question
In order to leave comments, you need to log in
if you have a user who constantly works with root rights, then there are options
1. include him in the root group
2. just enable the root login and not worry about the user account
3. write the necessary commands in sudoers that will be executed for him without asking for a password.
4. use sudo -i and continue as root by entering your password only 1 time.
and how about
PermitRootLogin without-passwordand add root to authorizrd_keys your key?
Actually, ssh and sudo are completely different things. If you want by key, then
1) enter some short name for the computer in /etc/hosts, for example 127.0.0.1 me
2) put the root key
3) instead of sudo -s do ssh [email protected]
Of course, you will not be able to run GUI programs (add -X).
My thoughts and how I do it at home :)
The password for sssh is not allowed - so as not to be picked up. Exit - use the keys (as it were clear)
The password must be complex, simply because you never know. Generated, recorded, locked up.
The administrator must have an account not equal to root, for example, newroot. To not guess. Because bots often break under root.
And also change the port ...
Do sudo without a password :) because it's convenient.
Well, you need to understand that there must be different users in the system. Ie, as it were, root is a system one, and your neroot will be for the admin. And www-data is for the web server. And then it will be clear who broke what and why you went to the server drunk (well, if there are logs). Something like this...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question