SSH Public Key Authentication: Difference between revisions

From MTU LUG Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
 
Line 1: Line 1:
In a terminal, type:
In a terminal on the local machine, type:
ssh-keygen -tdsa
ssh-keygen -t dsa
cd ~/.ssh
cd ~/.ssh


You'll then need to copy it to the remote host, you can do this via scp (command below) or via some other secure method.
You'll then need to copy it to the remote host, you can do this via scp (command below) or via some other secure method.
scp id_dsa.pub user@remote_host:.ssh
scp id_dsa.pub user@remote_host:.ssh/id_dsa.pub.new


ssh (or otherwise gain access) to the remote host and do the following:
ssh (or otherwise gain access) to the remote host and do the following:


cd ~/.ssh
cd ~/.ssh
Cat the public key from the client into the authorized_keys file
If the file authorized_keys is in the .ssh directory
cat id_dsa.pub >> authorized_keys
cat id_dsa.pub.new >> authorized_keys


That's it.
If the file authorized_keys is not in the .ssh directory
mv id_dsa.pub authorized_keys

Latest revision as of 21:41, 28 May 2005

In a terminal on the local machine, type:

ssh-keygen -t dsa
cd ~/.ssh

You'll then need to copy it to the remote host, you can do this via scp (command below) or via some other secure method.

scp id_dsa.pub user@remote_host:.ssh/id_dsa.pub.new

ssh (or otherwise gain access) to the remote host and do the following:

cd ~/.ssh

Cat the public key from the client into the authorized_keys file

cat id_dsa.pub.new >> authorized_keys

That's it.