diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2014-09-06 00:39:14 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2014-09-06 00:39:14 -0400 |
commit | ac4dcb64a8f6c07dfe50e9005dc4246f21ebf84e (patch) | |
tree | 8d9144bf1ab4c881f076ae2b7927516d764d89e0 /bin/list-ssh-authorized-keys | |
parent | 4b70501e432eb5fd9ed04a4afbadafabd982e9fc (diff) |
Split hackers.yml into users/#{uid}.yml
Diffstat (limited to 'bin/list-ssh-authorized-keys')
-rwxr-xr-x | bin/list-ssh-authorized-keys | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/bin/list-ssh-authorized-keys b/bin/list-ssh-authorized-keys deleted file mode 100755 index 0722b4f..0000000 --- a/bin/list-ssh-authorized-keys +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env ruby -# Usage: list-ssh-authorized-keys [username] -cfg_hackers="hackers.yml" -cfg_groups = [ "hackers", "bots" ] - -###################################################################### - -require 'yaml' - -users = YAML::load(open(cfg_hackers)) - -if ARGV[0] - users = users.find_all{|u|u["username"] == ARGV[0]} -else - users = users.find_all{|u|u["groups"] and not (u["groups"] & cfg_groups).empty?} -end - -users.each do |user| - if user["ssh_keys"] - user["ssh_keys"].each do |addr,key| - puts "#{key} #{user["fullname"]} (#{user["username"]}) <#{addr}>" - end - end -end |