Search code examples
authenticationsshamazon-ec2ssh-keysssh-keygen

Disable password and enable SSH keygen like AWS EC2 instances


I have a Proxmox hypervisor with 6 LXCs (servers) I have SFTP with chrooted user enabled on 4 of 6 LXCs with a custom port per LXC. Now I want the key authentication in FileZilla exactly like Amazon Web Services EC2 instances (a key.pem compatible with FileZilla and a authorized_keys file on my server in /home/user/.ssh/)

How to generate a key to .pem format who contents ? :

-----BEGIN RSA PRIVATE KEY-----
...
-----END RSA PRIVATE KEY-----

I know it's a noob question but I think it's first time I don't find what I want on Google or here on Stack Overflow

Thanks,

(Sorry for my English I'm a French baguette)


Solution

  • How to generate a key to .pem format who contents ? :

    Using ssh-keygen -t rsa -f rsa.pem. Without any arguments, you will get the default location and configuration.

    Other possibility is to use OpenSSL, that should do the same:

    openssl genrsa -out private.pem 2048