Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

From the Open-SSH Documentation what does username@remotehost mean in the following:

*By default the public key is saved in the file ~/.ssh/id_dsa.pub, while ~/.ssh/id_dsa is the private key. Now copy the id_dsa.pub file to the remote host and append it to ~/.ssh/authorized_keys by entering:*

ssh-copy-id username@remotehost

In my config file shouldn't I give access to the machine in which I wish to connect from?

  1. What exactly would I use for username@remotehost?
  2. Currently I wish to set up my Open-ssh server.

Note that I am using Ubuntu 12.04 LTS, thanks in advance!

EDIT: Could someone please tell me how to find what remotehost might look like for my machine? I need to know both for a Ubuntu machine and an Android device.

share|improve this question
    
man is your best linux friend or linux.die.net/man/1/ssh-copy-id, it'll copy public part of your ssh key to client username on machine remotehost through ssh. –  week Aug 26 '13 at 15:29
    
If you have your id_dsa.pub file on your client computer, than you can use cat id_dsa.pub >> ~/.ssh/authorized_keys. –  week Aug 26 '13 at 15:34
    
Okay, could you give me an example of what remotehost might look like? I am going to use an android device. –  CodeKingPlusPlus Aug 26 '13 at 15:36
add comment

2 Answers

up vote 1 down vote accepted

If you want to set up SSH on your local machine, then you don't need to use ssh-copy-id at all. That is only used when you want to use the keys you just generated to log into another machine (to which you already have password-based access).

If you want to use the keys to log into your local machine remotely, then you just need to append the public key to your local ~/.ssh/authorized_keys and use your private key for login when you need access to your machine.

share|improve this answer
    
could you give me step by step instructions? Such as with your client machine do this, then with your server machine do this? I am not following this at all otherwise. I do not have any experience in this realm other than basic UNIX tools. –  CodeKingPlusPlus Aug 26 '13 at 15:50
    
@CodeKingPlusPlus: Technically, the process doesn't really differ between your local machine or a remote machine. In either case you'd want to have a working password-based setup. The keys will just be a different mechanism. If you can log into your remote server via SSH, then the process is the same as for your local machine (except that you might not want to generate a new set of keys, but use an existing pair). I would advise you read this question: askubuntu.com/questions/46930/… Although I would recommend to protect your key with a password –  Oliver Salzburg Aug 26 '13 at 20:28
add comment

I found this tutorial not that long ago and it helped me create my keys. Maybe it could be of use to you as well. http://www.adminempire.com/create-ssh-keys/

HTH

share|improve this answer
    
You seem to only be posting answers referencing one particular blog. If this is your site or you are a contributor then you must disclose any affiliation otherwise your posts will be marked as spam and deleted by the community. –  Mokubai Sep 8 '13 at 19:34
    
Sorry not my blog or affiliated. Just was the one that has come up for me on my searches to answer my questions. Wont post anymore links to blogs my bad. –  Steve Sep 13 '13 at 16:53
    
Posting links to blogs in general is not bad, though we would prefer you post the actual content here and provide the link for reference, and I am sorry if it seemed like I was being rude or harsh. Please understand though that it seemed somewhat suspicious that your only answers on this site came from the same user on the same blog and we are quite protective where it comes to sites using us simply for advertising their blog or products. welcome to the community. –  Mokubai Sep 13 '13 at 17:12
    
Understood will make sure to do that in the future. Again sorry though for not following the rules properly. Rarely do I feel I can contribute back. –  Steve Sep 14 '13 at 18:57
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.