ssh root@<SERVER_IP>(on server) Create new user admin:
adduser admin
# create password for "admin" user(on server) Grant sudo priveleges to admin:
adduser admin sudo(on host) Add ssh keys:
ssh-copy-id -i $HOME/.ssh/<SSH_KEY_NAME>.pub admin@<SERVER_IP>(on host)
python3 -m venv venv
source venv/bin/activate
pip install ansible(on host)
cp ./hosts.example ./hosts
vim hosts
# add your <SERVER_IP> and <SSH_KEY_NAME>vim sudo_pass
# write sudo password for "admin" user herechmod go-rw sudo_passcheck that ansible is ready
ansible ubuntu -m ping(on host)
Install packages, disable root login, restart sshd:
ansible-playbook basic_setup_playbook.yaml --become-password-file sudo_passInstall docker:
ansible-playbook docker_playbook.yaml --become-password-file sudo_passInstall zsh, ohmyzsh, plugins:
ansible-playbook zsh_playbook.yaml --become-password-file sudo_passConfigure ssh alias
(on host)
cat << EOF >> $HOME/.ssh/config
Host <SERVER_ALIAS>
Hostname <SERVER_IP>
User admin
Port 22
IdentityFile ~/.ssh/<SSH_KEY_NAME>
ServerAliveInterval 20
TCPKeepAlive no
EOFconnect to server with alias:
ssh <SERVER_ALIAS>