Skip to content

Instantly share code, notes, and snippets.

@luoyjx
Created August 29, 2017 08:18
Show Gist options
  • Save luoyjx/e6d8f475f38e5299656a8fe3943b2539 to your computer and use it in GitHub Desktop.
Save luoyjx/e6d8f475f38e5299656a8fe3943b2539 to your computer and use it in GitHub Desktop.
shell 请求提权
#!/bin/bash
user=`whoami`
if [ "$user" != "root" ]; then
echo "You Password" | su root
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment