Answer the question
In order to leave comments, you need to log in
What is wrong with my head or with ssh?
I tried to make passwordless access via ssh, but something is not going well for me. Several times I managed to log in (transfer a file) without a password, but everything comes back. Link to instructions for creating passwordless access.
What could be causing the error?
Answer the question
In order to leave comments, you need to log in
try to execute on the machine where you need access:
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
and in general points 6-10 are done by the wonderful ssh-copy-id utility (comes with openssh). from a machine with freshly generated keys:
ssh-copy-id [email protected]_host
well, we create a key without a password, send the public key to the client in the .ssh/authorized_keys directory, and that's it, from that moment we go to the remote host by key. Well, essno we go by the user whose home contains the public key.
and what can't you do?
Somehow, I also suffered for a very long time with ssh, I redid everything from the beginning a hundred times.
It turned out that the problem was in the rights to the .ssh directory. Moreover, this is not a simple thing, but regulated by new settings, so in the old documentation there may not be a need to comply with them.
man sshd_config
StrictModes
Specifies whether sshd(8) should check file modes and ownership
of the user's files and home directory before accepting login.
This is normally desirable because novices sometimes accidentally
leave their directory or files world-writable. The default is
“yes”. Note that this does not apply to ChrootDirectory, whose
permissions and ownership are checked unconditionally.
Pavel Padozhnikov : Known_hosts file. what does he do?
known_hosts stores snapshots of remote servers that you have already connected to. Serves to ensure that the remote server could not be replaced imperceptibly.
For passwordless operation, you need two things:
have a private key on the server you are connecting from, for example /home/user/.ssh/id_rsa
have a public key on the server you are connecting to, for example in /home/user/.ssh/authorized_keys
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question