Skip to content

Instantly share code, notes, and snippets.

@RobSeder
Created June 7, 2023 15:33
Show Gist options
  • Save RobSeder/dc866cd1d13639e97393e02b871ddda4 to your computer and use it in GitHub Desktop.
Save RobSeder/dc866cd1d13639e97393e02b871ddda4 to your computer and use it in GitHub Desktop.
Change the non-privileged user prompt to show the FQDN. Copy that in place for root, and make roots prompt red instead of green.
#!/bin/bash
echo "[*] Show the full hostname in the prompt unprivileged prompt."
sed -i 's/\\h/$(hostname -f)/g' ~/.bashrc
source ~/.bashrc
echo "[*] Copy this file to /root/"
sudo cp ~/.bashrc /root/
echo "[*] Change the root prompt to be red."
sudo sed -i 's/01;32m/01;31m/g' /root/.bashrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment