$ brew install ssh-copy-id ==> Downloading http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-6.3p ######################################################################## 100.0% 🍺 /usr/local/Cellar/ssh-copy-id/6.3p1: 7 files, 208K, built in 9 seconds $ ssh-copy-id dev@dtvm /usr/local/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed /usr/local/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys dev@dtvm's password: Number of key(s) added: 1 Now try logging into the machine, with: "ssh 'dev@dtvm'" and check to make sure that only the key(s) you wanted were added.
If you use Mac OS X or some other *nix variant that doesn't come with ssh-copy-id, this one-liner will allow you to add your public key to a remote machine so you can subsequently ssh to that machine without a password.
Same as original just no $ at start
Alternative for machines without ssh-copy-id
If the username on the remote host is the same as on the local machine you can omit the username.
Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?
You must be signed in to comment.
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for: