Bug sequence - ssh password-free login cannot be used after giving the /root directory 777 permissions in the container

Linux——Create a container and locally debug a completely separated front-end and back-end project, package and upload it to docker to run

Then, when a 403 error occurred at the end of the previous article, the 403 error was solved by giving the /root directory 777 permissions.

chmod 777 /root

Now there is a new problem, the remote ssh cannot log in without secret, even through ssh-copy-id is useless.

 

This is probably because some kind of strange protection mechanism conflicts inside.

This article is a general solution

Possible reasons why a password is still required after ssh sets password-free login, and ssh problems or debugging methods_51CTO Blog_Ssh password-free login failure reasons

But I can't do it here. Once the /root directory is given 700 permissions or 550 permissions, my project will immediately report a 403 error. But at the same time, the ssh remote password-free login will also return to normal. So the two are already in conflict.

Originally, another solution was to put the front-end web project resources in the root directory instead of the /root directory

Linux---Take you to distinguish between "root directory" and "home directory"_What is the linux home directory_Hug@的博客-CSDN博客

 There will be no changes to the project path here, so the conflict is just a conflict, anyway, it is just a container.

Guess you like

Origin blog.csdn.net/m0_62327332/article/details/131165725