Use the -y option to ssh-keygen:
ssh-keygen -f ~/.ssh/id_rsa -y > ~/.ssh/id_rsa.pub
From the ‘man ssh-keygen’
-y This option will read a private OpenSSH format file and print an
OpenSSH public key to stdout.
Specify the private key with the -f option, yours might be dsa instead of rsa. The name of your private key probably contains which you used. The newly generated public key should be the same as the one you generated before.
Related Posts:
- Git: How to solve Permission denied (publickey) error when using Git?
- Permission denied (publickey,keyboard-interactive)
- How do I make ssh fail rather than prompt for a password if the public-key authentication fails?
- Add comment to existing SSH public key
- ssh connect Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password)
- Putty: Getting Server refused our key Error
- Copying a local file from Windows to a remote server using scp
- ssh: The authenticity of host ‘hostname’ can’t be established
- ssh “permissions are too open” error
- How to deal with “Pseudo-terminal will not be allocated because stdin is not a terminal.”
- What is actually in known_hosts?
- ‘heroku’ does not appear to be a git repository
- How to solve “sign_and_send_pubkey: signing failed: agent refused operation”?
- How to fix request failed on channel 0
- How to scp in Python?
- Forward X11 failed: Network error: Connection refused
- PuTTY PSCP error “Local to local copy not supported” when username contains a slash
- Starting ssh-agent on Windows 10 fails: “unable to start ssh-agent service, error :1058”
- Git error: “Host Key Verification Failed” when connecting to remote repository
- Convert PEM to PPK file format
- Copying files using rsync from remote server to local machine
- How to read iPhone files without jailbreaking?
- SSH to Vagrant box in Windows?
- How to use Sublime over SSH
- key_load_public: invalid format
- Use qdel to delete all my jobs at once, not one at a time
- Automating command/script execution using PuTTY
- Public and Private Keys are Incorrect for user
- How to automate SSH login with password?
- ssh returns “Bad owner or permissions on ~/.ssh/config”
- How do I tell Git for Windows where to find my private RSA key?
- How do I change my private key passphrase?
- How do diff over ssh?
- “Add correct host key in known_hosts” / multiple ssh host keys per hostname?
- SSH use only my password, Ignore my ssh key, don’t prompt me for a passphrase
- ssh-agent forwarding and sudo to another user
- Non interactive git clone (ssh fingerprint prompt) [duplicate]
- How to check sshd log?
- What does “Warning: untrusted X11 forwarding setup failed: xauth key data not generated” mean when ssh’ing with -X?
- What’s the difference between authorized_keys and authorized_keys2?
- Is my password compromised because I forgot to hit Enter after ssh username?
- ssh-keygen does not create RSA private key
- OpenSSH: Difference between internal-sftp and sftp-server
- What significance does the user/host at the end of an SSH public key file hold?
- SSH Suddenly returning Invalid format
- How can I prevent the warning No xauth data; using fake authentication data for X11 forwarding?
- How to recover from “Too many Authentication Failures for user root”
- SFTP logging: is there a way?
- Why does my OpenSSH key fingerprint not match the AWS EC2 console keypair fingerprint?
- Login without running bash_profile or bashrc
- How do I do Multihop SCP transfers between machines?
- scp without known_hosts check
- How do I validate an RSA SSH public key file (id_rsa.pub)?
- How to get a .pem file from ssh key pair?
- How can I run arbitrarily complex command using sudo over ssh?
- ssh connection takes forever to initiate, stuck at “pledge: network”
- What is the benefit of not allocating a terminal in ssh?
- bad ownership or modes for chroot directory component
- Why Block Port 22 Outbound?
- Ansible stuck on gathering facts
- Is it possible to use rsync over sftp (without an ssh shell)?
- SSH Allow Password For One User, Rest Only Allow Public Keys [duplicate]
- ssh : Permission denied (publickey,gssapi-with-mic)
- Chrome not Firefox are not dumping to SSLKEYLOGFILE variable
- File extension .DB – What kind of database is it exactly?
- Could not open a connection to your authentication agent
- What is the difference between a cer, pvk, and pfx file?
- How to establish ssh key pair when “Host key verification failed”
- AWS – Disconnected : No supported authentication methods available (server sent :publickey)
- How to encrypt String in Java
- Using putty to scp from windows to Linux
- mysql_config not found when installing mysqldb python interface
- Convert .pem to .crt and .key
- Simplest two-way encryption using PHP
- mysql_config not found when installing mysqldb python interface
- Pseudo-terminal will not be allocated because stdin is not a terminal
- Encrypt with private key and decrypt with public key
- How to use OpenSSL to encrypt/decrypt files?
- Encrypt Password in Configuration Files?
- Getting stty: standard input: Inappropriate ioctl for device when using scp through an ssh tunnel
- Copying files from server to local computer using SSH
- Is there any difference between aes-128-cbc and aes-128 encryption?
- EC2 ssh Permission denied (publickey,gssapi-keyex,gssapi-with-mic)
- How WordPress encrypt password? [duplicate]
- Are the default salts secure?
- Configure WordPress to connect to Mysql DB using SSH tunneling
- Store and Encrypt Contact Form 7 Submissions in Database? [closed]
- Failure to establish connection when provisioning via ansible-playbook server.yml
- Unable to update WordPress or install plugins/themes
- Using an Encryption class in a WordPress Plugin
- Pass MD5 value to prepopulate field
- SSH Server with WordPress
- AWS Lightsail WordPress – connect to database on instance using mysqli
- Retrieve $_POST data to send to javascript without using localize script
- Configuring WordPress permissions for easy updates
- How can I automatically change directory on ssh login?
- Does getting disconnected from an SSH session kill your programs?
- How can I fully log all bash scripts actions?
- Why is SSH password authentication a security risk?
- Making a user platform reachable by a qr code on a pin-back-button [closed]