How to generate RSA keys for linux system, CENTOS

PREREQUISITES

INSTALLED SSH SERVER
yum -y install openssh-server

CONFIGURED
vi /etc/ssh/sshd_config


PubkeyAuthentication yes
AuthorizedKeyFile .ssh/authorized_keys
# Enable only if ssh keys will be working
# PasswordAuthentication no
ChallengeResponseAuthentication no

RELOADED CONFIG
service sshd reload

1. GENERATE KEYS FROM WIN
puttygen

!!! If you want to upload public key to linux, you have to change to linux format, pleas see syntax below. !!!

You can copy public key copry from windows to server by command {this copy to home root directory to .ssh}

pscp your.pub root@serve.neucorp.org:.ssh

1.2 GENERATE KEYS FROM LINUX
01

Now you have to go to Linux and move your public key to

cd /home/user/.ssh/authorized_keys
cat your.pub >> authorized_keys

Now you have to check if is key file have correct syntax. Please see picture

2

COPY
You can copy the public key to other server, run the commands below.
cat ~/.ssh/id_rsa.pub | ssh root@Server_IP_Address “cat >> ~/.ssh/authorized_keys”

or
ssh-copy-id user@server_ip_address or hostname

!!! If you want to use private key in windows(putty), you have to change to putty format, please use putty gen !!!

convert to putty

3. USE BY PUTTY
useputty

CHECK ERROR
putty check error

SORUCE :

Facebook Comments