LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 12-25-2008, 07:10 AM   #1
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 676

Rep: Reputation: 137Reputation: 137
Public key authentication from QEMU


I have Linux box and it's host another Linux in VMware and yet another one in QEMU

I want to be able to login from both VMWare and QEMU to host computer without being asked password.

So I took usual route - generated private/public key with keygen (rsa keys),
put private key in the Linux on VMWare, (~/.ssh/id_rsa) public key in the host (~/.ssh/authorized_keys) and was able to login without password to host computer.

Now I copied ~/.ssh/id_rsa from VMWare into the Linux in QEMU, run ssh - and ooops - I prompted to enter password.

Also I copied ~/.ssh/id_rsa to the host computer and tried to ssh to myself (both as to real ip and to 127.0.0.1) - and again was prompted to enter password.

Any ideas how can I ssh from QEMU to host computer without password ?

Thank in advance.
Valery
 
Old 12-26-2008, 04:16 PM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
In the second VM you copied the id_rsa private key instead of the id_rsa.pub public key to the server's authorized_keys file. You need to append both public keys to the host's authorized_keys file. Other things that can prevent authentication include the permissions of your keys, the .ssh directory and the /home directory.

If you use ssh to connect to a remote client, having a passphrase protected key is a good idea. You can use `ssh-agent' & `ssh-add' to store your passphrase for the session. After that you won't be prompted for the password.

If the VMs and host are isolated in their own virtual subnet, then you don't really need the security of ssh AFAIK.

Last edited by jschiwal; 12-26-2008 at 07:19 PM.
 
Old 12-28-2008, 01:35 AM   #3
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 676

Original Poster
Rep: Reputation: 137Reputation: 137
Quote:
Originally Posted by jschiwal View Post
In the second VM you copied the id_rsa private key instead of the id_rsa.pub public key to the server's authorized_keys file. You need to append both public keys to the host's authorized_keys file. Other things that can prevent authentication include the permissions of your keys, the .ssh directory and the /home directory.

If you use ssh to connect to a remote client, having a passphrase protected key is a good idea. You can use `ssh-agent' & `ssh-add' to store your passphrase for the session. After that you won't be prompted for the password.

If the VMs and host are isolated in their own virtual subnet, then you don't really need the security of ssh AFAIK.
No, permissions are OK and I copied correct file to authorized_keys.
But now I half-solved the problem. I was able to login without password when I use DSA key. Interesting enough, that in QEMU (Debian 4.0, ARM) I was able log to with both DSA and RSA key. But in my Fedora8 x86_64 - only with DSA key.
RSA key doesn't work.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ssh public key authentication teacup Linux - Networking 4 11-27-2011 11:27 PM
Public key authentication with ssh elnacho12 Linux - Networking 3 12-18-2007 08:38 AM
SSHD and Public Key Authentication danthehat Linux - Software 1 05-01-2007 11:23 AM
Can't use public key authentication with SSH Noob69 Linux - General 5 01-06-2006 06:27 AM
Public key authentication problem Gameon Linux - Security 7 01-02-2004 06:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 11:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration