Saturday, May 28, 2011

remote SSH without type password everytime

SSH is a service use to remote to other machine in Linux or Mac in Terminal.
Here is the way that I Did with SSH to remote without type USERNAME and PASSWORD every time that I conncet or remote to other server.
Instead by using Key:

-----How TO---

#Go to ".ssh" folder On Ur computer and Generate the key  by:  
Open a terminal and type

cd .ssh

vannak@computer:~/.ssh$ ssh-keygen -b 1024 -t rsa -C

Note: Just Enter When the machine Ask..!!

Then u will have : id_rsa  known_hosts

#Copy to Ur Server in folder ".ssh" By:

vannak@computer:~/.ssh$ scp root@ur-server:.ssh/

Type ur root password when it ask..!!

# On Ur Server go to ".ssh" folder and generate the key

root@ur-server:~/.ssh$ ssh-keygen -b 1024 -t rsa

#On ur server Create a file name "authorized_keys" in ".ssh" folder

#Go to folder ".ssh" in Ur Server

root@ur-server:~/.ssh$ cat >> authorized_keys

#Access with the ShortCut Name:  EX: "" to "server"

    Host server
  User root
  IdentityFile /home/vannak/.ssh/id_rsa

So Next time U just TYPE:  "  ssh server " it log in automatically to ur server.

-------------That Done---U can SSH to Ur Server Without prompt for password Everytime From ur computer...!!------------

No comments:

Post a Comment