LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-25-2010, 07:14 AM   #1
tkmsr
Member
 
Registered: Oct 2006
Distribution: Ubuntu,Open Suse,Debian,Mac OS X
Posts: 798

Rep: Reputation: 39
ssh authorized keys from one directory to another directory did not worked


I have an access to a machine on lan via ssh and I use key based authentication.I created one more account on the remote machine and copied


Code:
cp home/oldaccount/.ssh/authorized_keys home/newaccount/.ssh/authorized_keys
Now when I tried to login to the other account via ssh from my laptop it did not worked.Though the copy of keys from laptop .ssh/id_rsa.pub to
remote machine new account .ssh/authorized keys did worked.

I was wondering I had added same keys to old account so why did simple copying the authorized keys from one account to another did not worked.
Because when I did cat id_rsa.pub > authorized_keys in new account I had created same file which was in old account.
Why is this happening or my observation is wrong.
 
Old 10-25-2010, 07:28 AM   #2
prayag_pjs
Senior Member
 
Registered: Feb 2008
Location: Pune - India
Distribution: RHEL/Ubuntu/Debian/Fedora/Centos/K3OS
Posts: 1,159
Blog Entries: 4

Rep: Reputation: 149Reputation: 149
Try ssh -v remote ip you may get any clue also see /var/log/secure
 
Old 10-25-2010, 07:51 AM   #3
djsmiley2k
Member
 
Registered: Feb 2005
Location: Coventry, UK
Distribution: Home: Gentoo x86/amd64, Debian ppc. Work: Ubuntu, SuSe, CentOS
Posts: 343
Blog Entries: 1

Rep: Reputation: 72
Quote:
Originally Posted by http://www.snailbook.com/faq/publickey-userauth.auto.html
File and Directory Permissions
Here's an issue that frequently trips people up: by default, sshd has requirements for the permissions on the authorized_keys file, as well as its containing directory ~/.ssh, and the home directory. Specifically, none of these may be writable by any uid except the owner or root. That means the most permissive modes you can have here are:

$ chmod 755 ~
$ chmod 755 ~/.ssh
$ chmod 644 ~/.ssh/authorized_keys

The reason for caring about the directory permissions, is that it doesn't do much good to protect the authorized_keys file, if someone else can simply delete it and create a new one (by modifying the containing directories).
I think the permissions may of changed before/when you copied it
 
Old 10-25-2010, 08:18 AM   #4
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,281

Rep: Reputation: 320Reputation: 320Reputation: 320Reputation: 320
And/Or owner and group of file. Change owner as newaccount, and check permissions.
 
Old 10-25-2010, 08:28 AM   #5
tkmsr
Member
 
Registered: Oct 2006
Distribution: Ubuntu,Open Suse,Debian,Mac OS X
Posts: 798

Original Poster
Rep: Reputation: 39
Yes you all are right permissions were the problem.

Last edited by tkmsr; 10-25-2010 at 08:33 AM.
 
  


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
Username & Password Sync Fedora Directory and Microsoft Active Directory karnac01 Fedora 4 07-19-2010 12:51 AM
change default vsftp anonymous accout directory /var/ftp to other directory? hocheetiong Linux - Newbie 2 01-24-2010 06:33 PM
Setting up authorized keys Elguapo Linux - Newbie 3 09-20-2008 07:37 AM
LXer: Directory services made easy with Fedora Directory Server LXer Syndicated Linux News 0 12-08-2006 03:54 AM
ssh to different directory other than home pridefc Linux - Software 5 11-17-2006 06:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:01 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