Created
April 8, 2024 11:06
-
-
Save csmr/6f916ceb6cfe673b926db56f38a55fa4 to your computer and use it in GitHub Desktop.
Debian Chef cookbook
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Cookbook:: debian_desktop | |
# Recipe:: default | |
# | |
# Install desktop environment | |
package 'xfce4' do | |
action :install | |
end | |
# Install common applications | |
%w(firefox thunderbird libreoffice gimp).each do |pkg| | |
package pkg do | |
action :install | |
end | |
end | |
# Set timezone | |
file '/etc/timezone' do | |
content 'America/Los_Angeles' | |
action :create | |
end | |
# Configure locale | |
execute 'dpkg-reconfigure locales' do | |
command 'dpkg-reconfigure locales' | |
not_if 'grep -q en_US.UTF-8 /etc/default/locale' | |
end | |
# Create user account | |
user 'user' do | |
password '$6$rounds=4096$...' | |
groups 'sudo' | |
home '/home/user' | |
action :create | |
end | |
# Copy SSH authorized keys | |
directory '/home/user/.ssh' do | |
owner 'user' | |
group 'user' | |
mode '0700' | |
action :create | |
end | |
file '/home/user/.ssh/authorized_keys' do | |
content 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCwINnRY0c3lq6CD1Lx75KqrJMEz8C/f9onzrqc8f8c+nWp/g+gjU4JILCkqOZblzM3h6rOJm+e8J1k8cYbf0tLTvLEaxfSnxQe9h2r9g+Y3/GPOHJhdl5NMGtW8uFA5fBqihR7qJdyEmTvphzDq0YVgBbyU9k+we6oKFQDY6rbDfrX73Tp1LlYROyKC4UD6h+L+WpCp+s9cFJE6EnD1wK2Mqj+DxXzBKkE3Y5e7QN0QAzWKg93bKNA1ujK5yHE3VaUwEgw2oKfTQXVZRrF6l1g6iIy3RODgzyPPbJ3/WLX/D3l8S4iUu0cAwEAAQ== user@laptop' | |
owner 'user' | |
group 'user' | |
mode '0600' | |
action :create | |
end | |
# Disable root login | |
file '/etc/ssh/sshd_config' do | |
owner 'root' | |
group 'root' | |
mode '0600' | |
content '...' | |
action :create | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment