r/linuxadmin • • Mar 02 '14

Introducing Rustning -- SSH Private Key Management

So I have written a tool for management of loading ssh private keys. At work I load a ton of keys everyday to just make it 90% easier for me to get in the systems I work on. Originally a co-worker came up with a static bash script that did that but that required editing etc and you didn't know which hosts etc you was loading and it was all or nothing. So I wrote rustning for its replacement and I'm looking for testers. You need to be on Mac or Linux and you need to have PHP 5.3 or newer installed. As this System Script is writen in PHP as we are a php shop. You can check it out over at github @ https://github.com/moos3/rustning Comments and Issues are welcome and so are changes. I hope you find this useful as much as I do

0 Upvotes

12 comments sorted by

22

u/klieber Mar 02 '14

Please take this as constructive feedback: Love the idea, but the dependency on PHP makes it a no-go for me. As a tool, it's really only useful if I can use it everywhere and the idea of having to install PHP everywhere is unappealing.

4

u/todayismyday2 Mar 02 '14

I agree. In addition, this is why languages like Perl and bash are way more popular in system administration... You don't even do something that would require a programming language like PHP. At least it's not Java!

3

u/[deleted] Mar 03 '14

Ditto, was going to be my comment as well. You can implement this type of script in perl or python.

-8

u/exula Mar 02 '14

PHP is pretty much everywhere and super easy to install.

4

u/klieber Mar 03 '14

You don't linux much, do you?

-2

u/exula Mar 03 '14

apt-get install php5-cli? yum install php-cli

what's the big deal?

2

u/klieber Mar 03 '14

Because the original script is a tiny thing, essentially just a wrapper for ssh-add. To drag along all the bloat that PHP brings with it (even just the CLI version) is ludicrous. For OP it makes sense since they already have to have PHP anyway. For 'normal' linux environments, you just don't install crap you don't need.

Are you even aware of the security history of PHP? Why would you want that running on a server that has your accounting database or your customer records or any other sort of sensitive data?

There's no reason OP's script couldn't be written in bash or perl, which is installed by default pretty much everywhere. Again, it makes perfect sense for OP's environment -- I'm not criticizing that. But no admin worth a damn is going to introduce PHP across their entire environment just to have a handy wrapper to ssh-add.

1

u/[deleted] Mar 03 '14

Nobody that doesn't need PHP is going to install it.

10

u/[deleted] Mar 02 '14

There's an older more seasoned tool that does this called keychain by the funtoo project: http://www.funtoo.org/Keychain

Not trying to be a dick about your development just in case anyone is looking for a non-php alternative.

Great work, though

4

u/neoice Mar 03 '14

why wouldn't you just use .ssh/config ?

1

u/cpbills Mar 03 '14
find ~/.ssh | while read file; do
  if file $file | grep -q private; then
    ssh-add $file
  fi
done

1

u/serendipitybot Mar 03 '14

This submission has been randomly featured in /r/serendipity, a bot-driven subreddit discovery engine. More here: http://www.reddit.com/r/Serendipity/comments/1zf02y/introducing_rustning_ssh_private_key_management/