View Single Post
danramos's Avatar
Posts: 4,672 | Thanked: 5,455 times | Joined on Jul 2008 @ Springfield, MA, USA
#22
Originally Posted by Laughing Man View Post
Ok I've gotten around to messing with this again. And I have several questions..

ssh-copy-id

What do I do with this command? The Ubuntu wiki says

"Assuming the remote Ubuntu computers you wish to use the keys for have running ssh daemons already, then locating your public portion of the key pair on those machines is quite simple. For example, if you'd like to begin using key-based logins as user username on a remote machine named host, and host is running sshd, and reachable by name on your network, simply use the ssh-copy-id command to properly locate your key:

ssh-copy-id -i ~/.ssh/id_rsa.pub username@host"

So username@host would be something like root@N800. Correct? But from where do I issue the command? My desktop/laptop (clients) or my tablet? (host?). And does this copy the ID onto whatever computer I need it on?


@danramos, I tried following your instructions though I didn't want to set an IP address. I'm going leave my desktop at home this year, and just bring my laptop with me to college so I'd need the ability to connect to it from my desktop or laptop depending on which network I am on. (at home, desktop. at college, my laptop).

And if I'm already logging into root via ssh, how would I switch it to the more secure key+ password? And how would this effect programs such as winscp or the Ubuntu Nautilus file manager?
Yep! On the server side, where you created your keys, you would issue a:
ssh-copy-id -i ~/.ssh/id_rsa.pub user@192.168.0.10 (assuming .10 is your tablet).


As for the IP address, you NEED to use the IP address inside your network as I'm sure you don't have a DNS server that you admin locally or hosts file to resolve the name to hosts. If you want to add your tablet to a fixed IP in your router's DHCP and then associate a name to that IP address, that would work while you're at home. But if you're roaming around in the cloud and connecting from, say, Burger King, that won't work.

You could do what I did, though. Set a fixed DHCP address for your laptop/server at home on your router... tell your router to route ALL traffic for a high and unusual port (let's say 2222) and route all traffic destined to port 2222 to your laptop/desktop's address at port 22. Then, set up a DynDNS.com domain name that will ALWAYS resolve to whatever your router reports to DynDNS as your current IP address with your ISP.

Once you're roaming around on the Internet cloud, you can go to a terminal session and type, say in this example:

ssh -p 2222 user@mydomain.dyndns.com

This assumes you got the name 'mydomain' from dyndns.com.

Let me know if I should flesh out any of that any further and I hope it helps you out.