Se o seu diretório pessoal estiver criptografado, o SSH não terá acesso ao authorized_keys
antes do login. Você precisa fazer o login com uma senha para o seu diretório pessoal para não ser criptografado.
Uma solução alternativa é alterar a origem das chaves autorizadas na configuração do SSH, conforme mencionado nos comentários. Outra é copiar seu authorized_keys
para seu diretório inicial. Supondo que você tenha privilégios de administrador, você pode:
- remonte o dispositivo raiz em outro local para que você tenha acesso ao seu diretório inicial (que é mascarado pelo diretório criptografado montado sobre ele quando você faz login)
- copie
~/.ssh/authorized_keys
lá, replicando a estrutura e as permissões
Primeiro, descubra qual dispositivo está montado em /
(use lsblk
, mount
, etc. - Usarei /dev/sda1
, por exemplo). Então:
sudo mount /dev/sda1 /mnt
mkdir "/mnt/$HOME/.ssh"
cp "$HOME/.ssh/authorized_keys" "/mnt/$HOME/.ssh/authorized_keys"
chmod -R og-rwx "/mnt/$HOME/.ssh"
Você terá que repetir a cópia toda vez que for atualizá-la.