LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-19-2013, 02:09 AM   #1
kashifchughtai
LQ Newbie
 
Registered: Jun 2009
Posts: 11

Rep: Reputation: 0
password less sftp connectivity using public key


hi guys,

i generated a public key some time back and provided to other party , say party A, so they can add it in their sftp service. after that i was able to connect without giving password.

now a new key is generated and provided to another party, say party B , will it impact the key wich was created earlier and provided to previous party A? do i have to give "party A" newly created public key again/?


regards,
kashif
 
Old 06-19-2013, 02:26 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
if you've generated a new key, then that new key would be used by default (presuming you've basically done a standard ssh-keygen). So an ssh service will be offered this new key instead. If you've got the old one, then it's trivial to tell your client to use a different key, but if it's gone then you would need to upload the new public key to the original service.
 
Old 06-19-2013, 02:41 AM   #3
kashifchughtai
LQ Newbie
 
Registered: Jun 2009
Posts: 11

Original Poster
Rep: Reputation: 0
i have a backup of old key, so if i replace the new key with old one then it should work without any issue?
 
Old 06-19-2013, 06:21 AM   #4
eklavya
Member
 
Registered: Mar 2013
Posts: 619

Rep: Reputation: 136Reputation: 136
If you are client and you have changed your keys, your new public key should be saved on server as authorized_keys.
If you are server and you have changed your keys, the public key of client is already saved on your system as authorized_keys.
 
Old 06-20-2013, 01:49 AM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,356

Rep: Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367
If you've created key setA (Pub+Priv)and sent PubA to A and then created a separate key setB and sent PubB to B, then they should both appear in /home/you/.ssh/known_hosts, and they will not affect each other.
 
Old 06-24-2013, 12:08 AM   #6
kashifchughtai
LQ Newbie
 
Registered: Jun 2009
Posts: 11

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by chrism01 View Post
If you've created key setA (Pub+Priv)and sent PubA to A and then created a separate key setB and sent PubB to B, then they should both appear in /home/you/.ssh/known_hosts, and they will not affect each other.

no actually keys are over-written and now i do have only set B. so i guess set A will not work anymore.
 
Old 06-24-2013, 07:57 PM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,356

Rep: Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367
That's not the normal thing; wonder how you did that... Having separate keys for each server you connect to is normal.
Simplest is either to grab a backup of KeyA (you do have backups, right...?) OR just create a new one and ssh-copy-id it over again to A.
http://www.thegeekstuff.com/2008/11/...n-ssh-copy-id/
You'll need the ability to login via passwd just this once; talk to the Admin of A.
 
Old 06-24-2013, 08:49 PM   #8
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora
Posts: 2,630

Rep: Reputation: 495Reputation: 495Reputation: 495Reputation: 495Reputation: 495
here this might help:

http://www.linuxquestions.org/questi...on-4175456100/

enjoy.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] SFTP fails public key authentication in batch mode chicagovol Linux - Newbie 1 05-26-2011 03:52 PM
SSH public key or password bortek Linux - Security 7 03-16-2010 06:38 PM
Public key authentication with ssh -- With out Password balakrishnay Linux - General 10 01-03-2010 10:41 PM
SFTP without password and without public/ private key iamakshay Programming 2 10-19-2009 04:35 PM
password policy with public key? pete83 AIX 7 02-04-2009 08:05 AM


All times are GMT -5. The time now is 08:43 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration