mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[compute] disable password auth for current user, rather than always root
This commit is contained in:
parent
9d017d8ab6
commit
3784effdd1
4 changed files with 4 additions and 4 deletions
|
@ -155,7 +155,7 @@ module Fog
|
|||
|
||||
commands = [
|
||||
%{mkdir .ssh},
|
||||
%{passwd -l root},
|
||||
%{passwd -l #{username}},
|
||||
%{echo "#{attributes.to_json}" >> ~/attributes.json}
|
||||
]
|
||||
if public_key
|
||||
|
|
|
@ -99,7 +99,7 @@ module Fog
|
|||
Fog::SSH.new(ips.first['address'], username, credentials).run([
|
||||
%{mkdir .ssh},
|
||||
%{echo "#{public_key}" >> ~/.ssh/authorized_keys},
|
||||
%{passwd -l root},
|
||||
%{passwd -l #{username}},
|
||||
%{echo "#{attributes.to_json}" >> ~/attributes.json}
|
||||
])
|
||||
rescue Errno::ECONNREFUSED
|
||||
|
|
|
@ -94,7 +94,7 @@ module Fog
|
|||
Fog::SSH.new(addresses['public'].first, username, credentials).run([
|
||||
%{mkdir .ssh},
|
||||
%{echo "#{public_key}" >> ~/.ssh/authorized_keys},
|
||||
%{passwd -l root},
|
||||
%{passwd -l #{username}},
|
||||
%{echo "#{attributes.to_json}" >> ~/attributes.json},
|
||||
%{echo "#{metadata.to_json}" >> ~/metadata.json}
|
||||
])
|
||||
|
|
|
@ -85,7 +85,7 @@ module Fog
|
|||
Fog::SSH.new(addresses.first, username, credentials).run([
|
||||
%{mkdir .ssh},
|
||||
%{echo "#{public_key}" >> ~/.ssh/authorized_keys},
|
||||
%{passwd -l root},
|
||||
%{passwd -l #{username}},
|
||||
%{echo "#{attributes.to_json}" >> ~/attributes.json}
|
||||
])
|
||||
rescue Errno::ECONNREFUSED
|
||||
|
|
Loading…
Add table
Reference in a new issue