Как исправить ошибку «Отказано в доступе» при использовании SSH

command:sed 's/^>[0-9]\{1,9\}\_/>/g' filename

выход

>CR-B_CR56_t
MTKIIKFVYFMTIFISPNHHCPVYNCTHPKQPWCKLVRLQLLFHGSLIGLCDCI
>R-B_R46_t
MVEVTKLVNVMLIFLTLSPLVYDCQAYECELPFKPDCLMVEYSPQFVALRCGCV
>N-N274_M
MVEVTKLVNVMLIFLTLFVYTDSDCQAYACELPFKPDCLMVEYAPQFFRLACGCV
0
10.03.2021, 12:26
1 ответ

Вы не можете быть уверены в проблеме без проверки бокового журнала сервера -. Во время работы ssh -vможно только догадываться. Если бы он явно показывал, что не так, это облегчило бы возможную атаку и раскрыло бы важную информацию для злоумышленника. Пример ниже:

debug1: Host '192.168.1.1' is known and matches the ECDSA host key.
debug1: Found key in /home/jiri/.ssh/known_hosts:30
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: Will attempt key: /tmp/test RSA SHA256:vOJarZ7K6aLtlnPvQnzx1MxA/36iV4xkubPY4PhlEKA explicit

Клиент пытается использовать ключ ssh в /tmp/test.

debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,sk-ssh-ed25519@openssh.com,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ecdsa-sha2-nistp256@openssh.com,webauthn-sk-ecdsa-sha2-nistp256@openssh.com>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Offering public key: /tmp/test RSA SHA256:vOJarZ7K6aLtlnPvQnzx1MxA/36iV4xkubPY4PhlEKA explicit
debug1: Authentications that can continue: publickey,keyboard-interactive

Сервер недоволен, не отображаетсяdebug1: Authentication succeeded (publickey).

debug1: Next authentication method: keyboard-interactive
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: No more authentication methods to try.
nonexistent@192.168.1.1: Permission denied (publickey,keyboard-interactive).

Вы не можете знать, ошибся ли пользователь, или ключ отсутствует, или применено ограничение на ключ, что приводит к сбою аутентификации. В приведенном выше примере пользователь вообще не существовал.

0
18.03.2021, 22:26

Теги

Похожие вопросы