Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
disabling a user by turning off their ssh access and disabling the password
{
"id": "bofh",
"ssh_keys": "ssh-rsa AAAAB3Nz...yhCw== bofh",
"groups": "sysadmin",
"uid": 2001,
"shell": "\/bin\/bash",
"comment": "BOFH",
"diabled": true
}
user u['id'] do
uid u['uid']
gid u['gid']
shell u['shell']
comment u['comment']
supports :manage_home => true
home home_dir
action u['disabled'] ? :lock : :create
notifies :create, "ruby_block[reset group list]", :immediately
end
if u['disabled']
file "#{home_dir}/.ssh/authorized_keys" do
action :delete
end
else
template "#{home_dir}/.ssh/authorized_keys" do
source "authorized_keys.erb"
owner u['id']
group u['gid'] || u['id']
mode "0600"
variables :ssh_keys => u['ssh_keys']
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.