csexton-ssh-keyput 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- metadata +4 -10
- data/README.markdown +0 -28
- data/VERSION.yml +0 -4
- data/lib/runner.rb +0 -58
- data/lib/ssh_keyput.rb +0 -33
- data/test/ssh_keyput_test.rb +0 -7
- data/test/test_helper.rb +0 -10
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: csexton-ssh-keyput
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christopher Sexton
|
@@ -10,25 +10,19 @@ bindir: bin
|
|
10
10
|
cert_chain: []
|
11
11
|
|
12
12
|
date: 2009-01-23 00:00:00 -08:00
|
13
|
-
default_executable:
|
13
|
+
default_executable: ssh-keyput
|
14
14
|
dependencies: []
|
15
15
|
|
16
16
|
description: TODO
|
17
17
|
email: csexton@gmail.com
|
18
|
-
executables:
|
19
|
-
|
18
|
+
executables:
|
19
|
+
- ssh-keyput
|
20
20
|
extensions: []
|
21
21
|
|
22
22
|
extra_rdoc_files: []
|
23
23
|
|
24
24
|
files:
|
25
|
-
- README.markdown
|
26
|
-
- VERSION.yml
|
27
25
|
- bin/ssh-keyput
|
28
|
-
- lib/runner.rb
|
29
|
-
- lib/ssh_keyput.rb
|
30
|
-
- test/ssh_keyput_test.rb
|
31
|
-
- test/test_helper.rb
|
32
26
|
has_rdoc: true
|
33
27
|
homepage: http://github.com/csexton/ssh-keyput
|
34
28
|
post_install_message:
|
data/README.markdown
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
ssh-keyput
|
2
|
-
==========
|
3
|
-
|
4
|
-
Copies your ssh public key to a server.
|
5
|
-
|
6
|
-
Because <i>ssh user@hostname "echo `cat ~/.ssh/id_dsa.pub` >> ~/.ssh/authorized_keys"</i> is too hard to remember.
|
7
|
-
|
8
|
-
Since OS X does not have the handy "ssh-copy-id" bash script by default I wanted to add a gem that I could install easily to perform the same task.
|
9
|
-
|
10
|
-
Currently I depend on a number of unix commands (like ssh and ssh-keygen), but I am sure that much of this could be replace by ruby libraries (and then we could make this gem dependent on those) but this does what I need it to and I don't have to remember complicated command lines.
|
11
|
-
|
12
|
-
It is pronounced "ssssh-kaput."
|
13
|
-
|
14
|
-
INSTALL
|
15
|
-
=======
|
16
|
-
|
17
|
-
> sudo gem install csexton-ssh-keyput -s http://gems.github.com
|
18
|
-
|
19
|
-
USAGE
|
20
|
-
=====
|
21
|
-
|
22
|
-
> ssh-keyput user@example.com
|
23
|
-
|
24
|
-
|
25
|
-
COPYRIGHT
|
26
|
-
=========
|
27
|
-
|
28
|
-
Copyright (c) 2008 Christopher Sexton. See LICENSE for details.
|
data/VERSION.yml
DELETED
data/lib/runner.rb
DELETED
@@ -1,58 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
# == Synopsis
|
4
|
-
# SSH Key Put Utility
|
5
|
-
#
|
6
|
-
# == Usage
|
7
|
-
# ssh-keyput [options]
|
8
|
-
#
|
9
|
-
# For help see http://github.com/csexton/ssh-keyput
|
10
|
-
|
11
|
-
require 'optparse'
|
12
|
-
|
13
|
-
module SshKeyPut
|
14
|
-
VERSION = "0.0.1"
|
15
|
-
|
16
|
-
class Runner
|
17
|
-
def self.runner
|
18
|
-
#@keyput = SshKeyPut::Base.new
|
19
|
-
|
20
|
-
self.parse_options
|
21
|
-
|
22
|
-
|
23
|
-
end
|
24
|
-
|
25
|
-
def self.parse_options
|
26
|
-
OptionParser.new do |opts|
|
27
|
-
|
28
|
-
opts.summary_width = 25
|
29
|
-
|
30
|
-
opts.banner = "ssh-keyput (#{SshKeyPut::VERSION})\n\n",
|
31
|
-
"usage: ssh-keyput [options...]\n",
|
32
|
-
|
33
|
-
opts.separator ""
|
34
|
-
opts.separator "Configuration:"
|
35
|
-
|
36
|
-
opts.on('-v', '--version') do
|
37
|
-
puts "ssh-keyput version (#{SshKeyPut::VERSION})\n\n"
|
38
|
-
exit
|
39
|
-
end
|
40
|
-
opts.on('-h', '--help') do
|
41
|
-
#RDoc::usage() #exits app
|
42
|
-
puts "#{opts}\n"
|
43
|
-
exit
|
44
|
-
end
|
45
|
-
opts.on('-V', '--verbose') do
|
46
|
-
puts "Verbose!"
|
47
|
-
end
|
48
|
-
opts.on('-r', '--generate') do
|
49
|
-
puts "Installing example .twitter_archive.yml to your home directory"
|
50
|
-
exit
|
51
|
-
end
|
52
|
-
|
53
|
-
end.parse!
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
SshKeyPut::Runner.runner
|
data/lib/ssh_keyput.rb
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'optparse'
|
4
|
-
require 'yaml'
|
5
|
-
require 'fileutils'
|
6
|
-
|
7
|
-
class SshKeyPut
|
8
|
-
|
9
|
-
attr_accessor :host, :key_file
|
10
|
-
|
11
|
-
def initialize
|
12
|
-
@key_file = "#{ENV["HOME"]}/.ssh/id_rsa.pub"
|
13
|
-
end
|
14
|
-
|
15
|
-
def version
|
16
|
-
v = YAML.load_file "#{File.dirname(__FILE__)}/../VERSION.yml"
|
17
|
-
"#{v[:major]}.#{v[:minor]}.#{v[:patch]}"
|
18
|
-
end
|
19
|
-
|
20
|
-
def put_key
|
21
|
-
unless (File.exists? @key_file)
|
22
|
-
puts "No key found, please run ssh-keyput --generate to make one"
|
23
|
-
end
|
24
|
-
|
25
|
-
#read in the key
|
26
|
-
key_code = File.open(@key_file).read.strip
|
27
|
-
|
28
|
-
system "ssh #{@host} \"mkdir ~/.ssh 2>/dev/null; chmod 700 ~/.ssh; echo '#{key_code}' >> ~/.ssh/authorized_keys; chmod 644 ~/.ssh/authorized_keys\""
|
29
|
-
end
|
30
|
-
|
31
|
-
end
|
32
|
-
|
33
|
-
|
data/test/ssh_keyput_test.rb
DELETED