2014년 9월 4일 목요일

How to make authorized_key from ssh, meaning it can log in Server without password

How to make authorized_key from ssh, meaning it can log in Server without password as long as we have public key.

How to do it
>sudo apt-get install ssh
>ssh-keygen -t rsa
>ls -al ~/.ssh/    ( Checking id_rsa.pub exists )
>cat  id_rsa.pub >> authorized_keys
>sudo chmod 700 ~/.ssh
>sudo chmod 700 ~/.ssh/id_rsa
>sudo chmod 700 ~/.ssh/authorized_keys

Now, we should do change a port relating to Server because a port, '20', used by remote client is blocked by KAIST.

>sudo vim /etc/ssh/sshd_config
>In it, check
>Chang the Port and PasswordAuthentication Yes-> No






































>sudo service ssh restart

But just for your information, if you want to connect in Windows' putty,
you should convert (id_rsa) to (.ppk) extension file.

It has a lot of work.
Actually, before I wrote this paper, I did many things wrong.
That means I turned around a right way to do this.

Download puttygen.exe on Website / http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html /

Then open this program > import a key from id_rsa made by ssh-keygen -t rsa
> Save a private key > by using this key, now we can log in Server through Putty
> How to do it? > Open putty > SSH > Auth > 'Browse' the private file > Connect!

Finished

댓글 없음:

댓글 쓰기