Skip to content

Keys_dir should contain just private key #127

@alinzh

Description

@alinzh

When I create a key using the commands:

ssh-keygen -t rsa
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys

the command yasetnode user@localhost returns next error:

/home/my_user_name/miniconda3/lib/python3.11/site-packages/asyncssh/public_key.py", line 3216, in import_private_key_and_certs 
    raise KeyImportError('Invalid private key') 
asyncssh.public_key.KeyImportError: Invalid private key

This error occurs because the .ssh/ directory contains both a private and public key. The AsyncSSH library processes all keys like a private (in decode_private), since the config file specifies the keys_dir path, and not path to a specific file with private key.

I think it should be stated in the documentation that keys_dir should store just private key.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationinvalidThis doesn't seem right

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions