ssh pub key auth - can some please guide me idiot proof


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers ssh pub key auth - can some please guide me idiot proof
# 1  
Old 10-27-2008
ssh pub key auth - can some please guide me idiot proof

hello.

can somebody please idiot proff simple guide me how to set up ssh public key authenciation?

i am stuck, i tried long and googled a lot but i cant get it.

thanks in advance.
# 2  
Old 10-27-2008
Sorry, that is a bit much you're asking for. Here are some good links where you get splendid information:

https://help.ubuntu.com/community/SSHHowto
How to set up SSH (for the beginner)

Follow them and when you come to a point where you are stuck, ask the appropriate question here.
# 3  
Old 10-27-2008
Terms:
client machine = your desktop
server machine = the machine you will be connecting to

assumptions:
you are using linux (if not let us know your OS)
you are using openssh (and openssl)
that ssh is installed and operational on the client machine and that sshd (server daemon) is installed and operational on the server machine. Check these two points by connecting to the server machine and supplying a password when prompted. If you get a shell prompt then both ssh on the client and sshd on the server are installed and operational.

Now, on to what you want to know.

1. at the command prompt on the client machine, logged in as the user that will be making the connection, run the following command:
Code:
ssh-keygen -t rsa

this will generate a public/private RSA protocol 2 key pair. If you need passwordless authentication, then just press enter each time it asks for a pass phrase, otherwise create a passphrase for use with this key.

2. you will now have a file called id_rsa.pub in your /home/user/.ssh directory.
this needs to be copied to the server machine - use scp to do this
Code:
scp /home/user/.ssh/id_rsa.pub server:id_rsa.pub.clientmachinename

3. now connect to the server machine and sign in as usual.

4. at the prompt on the server machine do this
Code:
cd
mkdir -p .ssh
cat id_rsa.pub.clientmachinename >>.ssh/authorized_keys
chmod 700 .ssh
chmod 600 .ssh/authorized_keys

5. log out of the server machine.

6. log back into the server machine, if all goes well, you will be asked for the passphrase you set for the key pair (or you will be connected directly, without asking for the passphrase or your login password, if the key pair has no passphrease)

7. repeat from step 2 for other machines you will need to connect to from the client machine, there is no need to create more than one key pair, it can be used for all machines you connect to.
# 4  
Old 10-27-2008
big thanks a lot, i am trying now Smilie SmilieSmilieSmilie
# 5  
Old 10-27-2008
Good guide Wempy Smilie, I was about to post something very similar as I've spent the last week finding out those exact steps, which is all a newbie really needs to know for SSH.
The problem with the guides on the 'net is that they frequently forget the bleeding obvious such as which fragging machine is the client and which one is the server, and which commands/files go on which one.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Does vsftpd support user access with client certificate with priv/pub key + vsftpd certificate?

:rolleyes:I am trying to setup all certificate based client-server environment in Linux using vsftpd and curl with openssl. I would like to make a user access with vsftpd certificate and user own client certificate (self-signed) with private/public key. I don't see google posts about the my plan... (4 Replies)
Discussion started by: gogogo
4 Replies

2. Shell Programming and Scripting

Rsync in bash script doesn't work even after placing pub key in target server

Hello Friends, My bash script is like this #!/bin/bash # request Bourne shell as shell for job #$ -S /bin/bash # assume current working directory as paths #$ -cwd #$ -N rsync-copy # # print date and time date rsync -rltD --progress "ssh -i /home/myname/.ssh/id_rsa"... (4 Replies)
Discussion started by: jacobs.smith
4 Replies

3. Solaris

Solaris 8 ssh public key authentication issue - Server refused our key

Hi, I've used the following way to set ssh public key authentication and it is working fine on Solaris 10, RedHat Linux and SuSE Linux servers without any problem. But I got error 'Server refused our key' on Solaris 8 system. Solaris 8 uses SSH2 too. Why? Please help. Thanks. ... (1 Reply)
Discussion started by: aixlover
1 Replies

4. AIX

ssh public key auth "Remote login for account is not allowed" ?

Hello, Using AIX 6.1 boxes. User user1 connects from box A to box B using ssh. When password authentication is used everything is fine. When I configure user1 to use public key authentication sftp client works fine(no password asked), but ssh client fails. This is sshd log: Accepted publickey... (3 Replies)
Discussion started by: vilius
3 Replies

5. Shell Programming and Scripting

Rename .pub and private key

I wish to generate a id_dsa.pub and id_dsa (Public and Private Key) in a common user group. I have checked the .ssh directory and i have already found id_dsa.pub and id_dsa existing. Is that OK if i create both the keys in my home direcotry, rename it to jjj.pub and jjj and move to Common user... (1 Reply)
Discussion started by: vasuarjula
1 Replies

6. Shell Programming and Scripting

Difference in auth key commands?

Good morning! What is the difference between: ssh-keygen -t rsa and ssh-keygen -b 2048 -t rsa? Thanks Bigben (2 Replies)
Discussion started by: bigben1220
2 Replies

7. Shell Programming and Scripting

Stuck again..verify an auth key-then create on if not there

Good morning!!! Im trying to create a script that will verify an auth key-then create on if not there. IThe script is trying to be vague to be used on whatever machine I choose. Ok so heres the code: #!/bin/bash KEY=~root/.ssh/id_rsa.pub Host=$1 Key=`ssh $Host "ls -l $KEY"` if... (8 Replies)
Discussion started by: bigben1220
8 Replies

8. UNIX for Dummies Questions & Answers

ssh login and auth errors

Hi folks, I'm having some rather odd trouble with ssh. It all started when I tried to create rsa public/private keys to login to a remote ssh account. The account is on a university server and the address redirects to several different machines so (following their wiki instructions...sigh) I... (9 Replies)
Discussion started by: daytripper
9 Replies

9. AIX

SSH + LDAP Auth Giving Fits

I'm having a bear of a time getting my LDAP connection going, so I hope someone here has some insight. I have AIX 5.3 running on an LPAR. I have ldap-client, ldap-max-crypto-client, gskak, and gskte installed. I'm able to set up the connection via mksecldap, and I can query users just fine... (1 Reply)
Discussion started by: AlexDeGruven
1 Replies

10. OS X (Apple)

Idiot's Guide to Mac OSX BSD?

Hi, I am used to Solaris and find my Macs confusing when using the command line. This particularly applies to top, networking and users configuration. Top just seems to be hopeless in comparison to the Solaris version and the network and user configuration just doesn't seem to work. Is there a... (11 Replies)
Discussion started by: pettefar
11 Replies
Login or Register to Ask a Question