3 ms·
Just looked up a real "sed" example in linux vs linux. DigitalOcean ships VM that don't have an admin group. So when I tried DO, I added: grep -q 'admin' /etc
by hbbio 13y ago
Just looked up a real "sed" example in linux vs linux.
DigitalOcean ships VM that don't have an admin group. So when I tried DO, I added:
grep -q 'admin' /etc/group || groupadd admin
Or, for changing the sshd port:
sed -i -r 's/^#?Port [0-9]*/Port '"$PORT"'/' /etc/ssh/sshd_config
Works great on all platforms... regardless of the default sshd_config.
- dalore 13y agoYou realise that the tools like ansible are made for making sure the groups and users you specify in your config are going to be on the server? That's the point of them. Don't rely on a presetup environment, you'r ansible scripts should setup the environment for everything you need.