How to generate RSA keys for linux system, CENTOS

PREREQUISITES

INSTALLED SSH SERVER
yum ‑y install openssh-server

CONFIGURED
vi /etc/ssh/sshd_config


Pub­keyAu­then­ti­ca­tion yes
Autho­rized­Key­File .ssh/authorized_keys
# Enable only if ssh keys will be working
# Pass­wor­dAu­then­ti­ca­tion no
Chal­len­geRe­spon­seAu­then­ti­ca­tion no

RELOADED CONFIG
ser­vice sshd reload

1. GENERATE KEYS FROM WIN
puttygen

!!! If you want to upload pub­lic key to lin­ux, you have to change to lin­ux for­mat, pleas see syn­tax below. !!!

You can copy pub­lic key copry from win­dows to serv­er by com­mand {this copy to home root direc­to­ry to .ssh}

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

1.2 GENERATE KEYS FROM LINUX
01

Now you have to go to Lin­ux and move your pub­lic key to

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

Now you have to check if is key file have cor­rect syn­tax. Please see picture

2

COPY
You can copy the pub­lic key to oth­er serv­er, run the com­mands 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 pri­vate key in windows(putty), you have to change to put­ty for­mat, please use put­ty gen !!!

convert to putty

3. USE BY PUTTY 
useputty

CHECK ERROR
putty check error

SORUCE :

Face­book Comments