LinuxQuestions.org
Social Bookmarking all things Linux and Open Source
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices

Reply
 
Thread Tools
Old 11-05-2009, 06:21 AM   #1
SibLiant
LQ Newbie
 
Registered: Dec 2006
Posts: 8
Thanked: 0
ssh -i does not use my identity file?


[Log in to get rid of this advertisement]
Hi Community,

So I have a remote web server running etch. I had password-less access working until I screwed it up (not sure how yet). I created rsa keys in ~/.ssh . Once those are created, I do an ssh-copy-id back home where i want to dump my /var/www . Now.. it should be as simple as using ssh -i ~/.ssh/identity user@host right? I continually get prompted for a password from my server at home. ok. I do ssh-agent and get:

Code:
SSH_AUTH_SOCK=/tmp/ssh-BjmLPg2413/agent.2413; export SSH_AUTH_SOCK;
SSH_AGENT_PID=2414; export SSH_AGENT_PID;
echo Agent pid 2414;
ok.. start from scratch:

create a new key
Code:
ssh-keygen -t rsa -b 2048 -f ~/.ssh/mykey
ok.. copy the new key to the server:
Code:
ssh-copy-id "-p34045 -i~/.ssh/mykey.pub me@myhost"
/usr/bin/ssh-copy-id: ERROR: No identities found

hu?? do ls -la ~/.ssh
Code:
-rw------- 1 parker parker  775 2009-10-31 06:43 authorized_keys
-rw------- 1 parker parker 1671 2009-11-05 05:06 identity
-rw------- 1 parker parker  396 2009-11-05 05:06 identity.pub
-rw-r--r-- 1 parker parker 3978 2009-11-01 08:49 known_hosts
-rw------- 1 parker parker 1675 2009-11-05 05:08 mykey
-rw------- 1 parker parker  396 2009-11-05 05:08 mykey.pub

Where am i being an id10t?

Last edited by SibLiant; 11-05-2009 at 06:25 AM..
linux SibLiant is offline     Reply With Quote
Old 11-05-2009, 07:15 AM   #2
zhjim
Member
 
Registered: Oct 2004
Distribution: Debian lenny & etch, Red Hat 4.0, (used slackware 11.0)
Posts: 445
Blog Entries: 2
Thanked: 29
Quote:
Originally Posted by SibLiant View Post
Where am i being an id10t?
I dunno know but a good guess is in front of the mirror where you see one
Paddon but I can't dispel an invitation.

I don't know what ssh-copy-id does but to check that every thing went well cat ~/.ssh/authorized_keys to see if your key.pub made it over. Check on your /etc/ssh/sshd_config to get the exact name of the file where pub keys need to go.
As far as I can tell the permissions look good on the files.

Bit of summary what's need for public key login
pair of keys, one public one private.
The public one needs to get on the server you want to log in to
put public key into .ssh/authorized_keys (or where ever sshd looks for it)
Make sure sshd allows public key login.

For debug purpose use ssh -v -v and see what it tells you. Even more intresting and most of the time illuminating is the sshd log /var/log/secure normaly. But first setup the log level to debug inside /etc/ssh/sshd_config restart ssh and tail on the logfile. Or just start sshd by hand and let it linger in foreground.

To make extra sure heres I go about public key login
Code:
ssh-keygen -t rsa -b 2048
it'll ask for the place to save the files to (.ssh in general)
Code:
scp .ssh/id_rsa.pub user@host:/home/user/.ssh/authorized_keys
take care not to overwrite any existing authorized_keys file.
Code:
ssh user@host
I normaly ssh into the machine to check on permission and alike...
windows_xp_2003 zhjim is offline     Reply With Quote
Thanked by:
Old 11-05-2009, 07:43 PM   #3
SibLiant
LQ Newbie
 
Registered: Dec 2006
Posts: 8
Thanked: 0

Original Poster
Thanks for the detail. I check the authorized keys on the server and it was clearly not going in using ssh-copy-id and I have no clue why. I used
Code:
cat ~/.ssh/identity.pub | ssh myhost -p34045 "cat >> ~/.ssh/authorized_keys"
and the key copied over and everything was good. Thanks for leading to this end.
linux SibLiant is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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
cat file over ssh and put it into log file sinister1 Programming 2 04-24-2009 01:54 AM
file time stamp is wrong with ssh file transfer cy163 Linux - Newbie 8 05-18-2008 02:40 AM
How can I hide my identity while connected with ssh server kingkazmi1988 Linux - Newbie 2 11-09-2007 06:30 PM
ssh without identity files veeruk101 Linux - Networking 1 07-16-2007 10:04 PM
Balsa/identity file/clean reinstallation rickyguo Linux - Software 0 08-19-2003 09:55 PM


All times are GMT -5. The time now is 10:49 PM.

Main Menu
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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration