SSH public key exchange

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite












I frequently SSH into a remote Linux server of which I am an authorized user. In order to make the communication more secure, I setup the public/private key authentication instead of using password for login. I sent my public key to server's administrator and he added it to ".ssh/authorized_keys" under my home directory. Everything went well right off the bat and I could connect from my Linux laptop to the server without using my password on first attempt.



Now the question - if server's administrator had accidentally placed my public key under another user's "authorized_keys" then could I have logged in as that user?



(PS: If the answer is "yes" then I'd be very very very careful if I were an administrator because seems like somewhat easy mistake to make.)



Let me know if additional information is needed to answer the question correctly.



Thanks!







share|improve this question
















  • 1




    Yes, but you need to know which user's authorized_keys file the admin added your key to. BTW - instead of sending the key to the admin, you could probably have used ssh-copy-id and done it yourself....
    – ivanivan
    Jan 30 at 20:35










  • @ivanivan Thanks for the ssh-copy-id tip, I will remember it for next time. Your comment about the knowledge of username also makes sense. That makes me somewhat less spooked now. But still spooked nonetheless.
    – user309223
    Jan 30 at 20:48














up vote
2
down vote

favorite












I frequently SSH into a remote Linux server of which I am an authorized user. In order to make the communication more secure, I setup the public/private key authentication instead of using password for login. I sent my public key to server's administrator and he added it to ".ssh/authorized_keys" under my home directory. Everything went well right off the bat and I could connect from my Linux laptop to the server without using my password on first attempt.



Now the question - if server's administrator had accidentally placed my public key under another user's "authorized_keys" then could I have logged in as that user?



(PS: If the answer is "yes" then I'd be very very very careful if I were an administrator because seems like somewhat easy mistake to make.)



Let me know if additional information is needed to answer the question correctly.



Thanks!







share|improve this question
















  • 1




    Yes, but you need to know which user's authorized_keys file the admin added your key to. BTW - instead of sending the key to the admin, you could probably have used ssh-copy-id and done it yourself....
    – ivanivan
    Jan 30 at 20:35










  • @ivanivan Thanks for the ssh-copy-id tip, I will remember it for next time. Your comment about the knowledge of username also makes sense. That makes me somewhat less spooked now. But still spooked nonetheless.
    – user309223
    Jan 30 at 20:48












up vote
2
down vote

favorite









up vote
2
down vote

favorite











I frequently SSH into a remote Linux server of which I am an authorized user. In order to make the communication more secure, I setup the public/private key authentication instead of using password for login. I sent my public key to server's administrator and he added it to ".ssh/authorized_keys" under my home directory. Everything went well right off the bat and I could connect from my Linux laptop to the server without using my password on first attempt.



Now the question - if server's administrator had accidentally placed my public key under another user's "authorized_keys" then could I have logged in as that user?



(PS: If the answer is "yes" then I'd be very very very careful if I were an administrator because seems like somewhat easy mistake to make.)



Let me know if additional information is needed to answer the question correctly.



Thanks!







share|improve this question












I frequently SSH into a remote Linux server of which I am an authorized user. In order to make the communication more secure, I setup the public/private key authentication instead of using password for login. I sent my public key to server's administrator and he added it to ".ssh/authorized_keys" under my home directory. Everything went well right off the bat and I could connect from my Linux laptop to the server without using my password on first attempt.



Now the question - if server's administrator had accidentally placed my public key under another user's "authorized_keys" then could I have logged in as that user?



(PS: If the answer is "yes" then I'd be very very very careful if I were an administrator because seems like somewhat easy mistake to make.)



Let me know if additional information is needed to answer the question correctly.



Thanks!









share|improve this question











share|improve this question




share|improve this question










asked Jan 30 at 20:32









user309223

111




111







  • 1




    Yes, but you need to know which user's authorized_keys file the admin added your key to. BTW - instead of sending the key to the admin, you could probably have used ssh-copy-id and done it yourself....
    – ivanivan
    Jan 30 at 20:35










  • @ivanivan Thanks for the ssh-copy-id tip, I will remember it for next time. Your comment about the knowledge of username also makes sense. That makes me somewhat less spooked now. But still spooked nonetheless.
    – user309223
    Jan 30 at 20:48












  • 1




    Yes, but you need to know which user's authorized_keys file the admin added your key to. BTW - instead of sending the key to the admin, you could probably have used ssh-copy-id and done it yourself....
    – ivanivan
    Jan 30 at 20:35










  • @ivanivan Thanks for the ssh-copy-id tip, I will remember it for next time. Your comment about the knowledge of username also makes sense. That makes me somewhat less spooked now. But still spooked nonetheless.
    – user309223
    Jan 30 at 20:48







1




1




Yes, but you need to know which user's authorized_keys file the admin added your key to. BTW - instead of sending the key to the admin, you could probably have used ssh-copy-id and done it yourself....
– ivanivan
Jan 30 at 20:35




Yes, but you need to know which user's authorized_keys file the admin added your key to. BTW - instead of sending the key to the admin, you could probably have used ssh-copy-id and done it yourself....
– ivanivan
Jan 30 at 20:35












@ivanivan Thanks for the ssh-copy-id tip, I will remember it for next time. Your comment about the knowledge of username also makes sense. That makes me somewhat less spooked now. But still spooked nonetheless.
– user309223
Jan 30 at 20:48




@ivanivan Thanks for the ssh-copy-id tip, I will remember it for next time. Your comment about the knowledge of username also makes sense. That makes me somewhat less spooked now. But still spooked nonetheless.
– user309223
Jan 30 at 20:48










1 Answer
1






active

oldest

votes

















up vote
2
down vote














if server's administrator had accidentally placed my public key under another user's "authorized_keys" then could I have logged in as that user?




In a word: yes. The same way as if they sent you the other user's password, or saved your password under the other user's account.






share|improve this answer
















  • 2




    The only exception perhaps is that both admin and I would think twice before sending out passwords to each other. However, public key is public information that I (or admin) might be little less careful about. But I see the point of you analogy. Thank you.
    – user309223
    Jan 30 at 20:53










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f420794%2fssh-public-key-exchange%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
2
down vote














if server's administrator had accidentally placed my public key under another user's "authorized_keys" then could I have logged in as that user?




In a word: yes. The same way as if they sent you the other user's password, or saved your password under the other user's account.






share|improve this answer
















  • 2




    The only exception perhaps is that both admin and I would think twice before sending out passwords to each other. However, public key is public information that I (or admin) might be little less careful about. But I see the point of you analogy. Thank you.
    – user309223
    Jan 30 at 20:53














up vote
2
down vote














if server's administrator had accidentally placed my public key under another user's "authorized_keys" then could I have logged in as that user?




In a word: yes. The same way as if they sent you the other user's password, or saved your password under the other user's account.






share|improve this answer
















  • 2




    The only exception perhaps is that both admin and I would think twice before sending out passwords to each other. However, public key is public information that I (or admin) might be little less careful about. But I see the point of you analogy. Thank you.
    – user309223
    Jan 30 at 20:53












up vote
2
down vote










up vote
2
down vote










if server's administrator had accidentally placed my public key under another user's "authorized_keys" then could I have logged in as that user?




In a word: yes. The same way as if they sent you the other user's password, or saved your password under the other user's account.






share|improve this answer













if server's administrator had accidentally placed my public key under another user's "authorized_keys" then could I have logged in as that user?




In a word: yes. The same way as if they sent you the other user's password, or saved your password under the other user's account.







share|improve this answer












share|improve this answer



share|improve this answer










answered Jan 30 at 20:46









ilkkachu

49.8k674137




49.8k674137







  • 2




    The only exception perhaps is that both admin and I would think twice before sending out passwords to each other. However, public key is public information that I (or admin) might be little less careful about. But I see the point of you analogy. Thank you.
    – user309223
    Jan 30 at 20:53












  • 2




    The only exception perhaps is that both admin and I would think twice before sending out passwords to each other. However, public key is public information that I (or admin) might be little less careful about. But I see the point of you analogy. Thank you.
    – user309223
    Jan 30 at 20:53







2




2




The only exception perhaps is that both admin and I would think twice before sending out passwords to each other. However, public key is public information that I (or admin) might be little less careful about. But I see the point of you analogy. Thank you.
– user309223
Jan 30 at 20:53




The only exception perhaps is that both admin and I would think twice before sending out passwords to each other. However, public key is public information that I (or admin) might be little less careful about. But I see the point of you analogy. Thank you.
– user309223
Jan 30 at 20:53












 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f420794%2fssh-public-key-exchange%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Displaying single band from multi-band raster using QGIS

How many registers does an x86_64 CPU actually have?