LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Enterprise (https://www.linuxquestions.org/questions/linux-enterprise-47/)
-   -   need help on /etc/ssh/sshd_config (https://www.linuxquestions.org/questions/linux-enterprise-47/need-help-on-etc-ssh-sshd_config-4175603934/)

manoj.linux 04-16-2017 05:19 AM

need help on /etc/ssh/sshd_config
 
Hi,

I am able to rsync OS configuration to another server using public keys and enabling Permit root login yes in /etc/ssh/sshd_config

but my requirement is Permit root login should be no , and it should work with public keys, is it possible if yes then how?

Turbocapitalist 04-16-2017 05:25 AM

Which version of OpenSSH are you using? There are some differences in that area depending on version. Check the manual page for what the directive PermitRootLogin allows:

Code:

man sshd_config
If your Rsync usage has the same options every time, then you can set up a regular user for that and apply a specially configured line to /etc/sudoers to make it possible to run as root: https://en.wikibooks.org/wiki/OpenSS...rsync_and_sudo

For that you'll need to run the SSH client with the first level of verbosity -v and use what's shown there to craft your line in /etc/sudoers on the server.

lazydog 04-16-2017 07:35 AM

There are ways to rsync backup without allowing root to login.
THIS goes a long way today.

TB0ne 04-16-2017 09:11 AM

Quote:

Originally Posted by manoj.linux (Post 5697586)
Hi,
I am able to rsync OS configuration to another server using public keys and enabling Permit root login yes in /etc/ssh/sshd_config but my requirement is Permit root login should be no , and it should work with public keys, is it possible if yes then how?

manoj.linux, you've been here ten years at this point, and have asked many questions like this, that show little (if any) effort on your part. You've been repeatedly asked to read the "Question Guidelines" about doing your own research also. And, you asked something very similar to this IN 2007:
http://www.linuxquestions.org/questi...roblem-599288/

In the ten years that has passed since that question, have you learned nothing about SSH, or even tried to read the man pages on the configs? You asked about SSH two years ago as well:
http://www.linuxquestions.org/questi...sh-4175548881/

...similarly, about using keys for passwordless logins. I'm sorry, but an administrator with a DECADE of experience should be able to do some small amount of research of their own, especially since you've been told to many times in the past. The very first hit in Google for "rsync over ssh without password" is a complete how-to, which you can find if you go look.

Did you attempt to apply anything from your past threads, or do research on this first, before you posted?


All times are GMT -5. The time now is 06:39 AM.