4 ms·
Use a config file to SSH into a server
- lardissone 12y agoI would love a kind of launcher for hosts in config file. Say, something like: ~ sshlaunch[enter] Select host: [0] Test1 [1] Test2 [2] Test3 Enter host number and hit enter:
- untrothy 12y agoThis probably isn't to difficult to implement, hell I could even try to write something like that right now and put it on github. (I would have simply sent you an email but you don't have one in your profile) EDIT: You will need python3 since I used input(), and this probably is my first python script so it's a bit messy: https://gist.github.com/anonymous/e13d3d743c77bc1e39e6 https://gist.github.com/anonymous/e13d3d743c77bc1e39e6
- cones688 12y agoWhy does no one ever mention ssh-copy-id?! Is part of Openssh and copies across your default pub key to the server in question. ssh-copy-id user@server Edit: Add more info
- tmikaeld 12y agonot sure, maybe not standard enough? i always use it myself, so much more comfortable
- bigd 12y agobecause is not present in the mac default installation
- batuhanicoz 12y agoBut it is very easy to install if you have Homebrew and I'm guessing everyone who needs ssh-copy-id would already have homebrew installed. Just do: brew install ssh-copy-id
- cones688 12y agoDoes osx not use Openssh Package? On Fedora here so had always wondered why all these setup guides included this step.. the osx thing might explain it.
- Touche 12y agoProbably because the top Google result tells you to do it the way explained in this article. I did it that way for years before finding out about ssh-copy-id.
- Bob_Sheep 12y agoscp is another option if ssh-copy-id is not available
- emiunet 12y agoIn a lot of environments, the SSH servers are listening on some non-standard port. I don't see an option in ssh-copy-id to specify the SSH server port.
- tmikaeld 12y agoNice article, you could add this for added wow factor https://github.com/emre/storm https://github.com/emre/storm
- gjvc 12y agowhat's next? tail(1)?
- mail2vks 12y agoHad to upvote. Exactly my sentiments
- deleted 12y ago[deleted]
- api_or_ipa 12y agoUsually after setting up ssh RSA keys, I'll alias it to something significantly shorter. Works pretty good.
- jjjeffrey 12y agoThis is great! Some other things about ssh that everyone knew but me (until I found out): -scp supports bash completion for files on the server if you use a key pair. -Keychain (http://www.funtoo.org/Keychain http://www.funtoo.org/Keychain) makes having a password on your private key less of a hassle by prompting for your password when you first log in to your local account and using that when you ssh. (ssh-agent alone is similar but requires your password for every new login session).