Useful entry level reading for someone that's never used linux before....
http://www.creativecrash.com/tutorials/the-unix-shell-for-vfx-artists#tabs
#include#include #include #include using namespace std; int main(int argc, char* argv[]) { setuid( 0 ); string cmd = "/opt/local/cmd.sh"; for (int i = 1; i < argc; i++) { string arg (argv[i]); cmd += " "; cmd += arg; } int exitcode; exitcode = system(cmd.c_str()); return WEXITSTATUS(exitcode); }
gcc runscript.c -o runscript sudo chown root:root runscript sudo chmod 4750 runscript
group ALL = NOPASSWD: /path/to/script
sudo /path/to/script
[xdmcp] Enable=true [security] DisallowTCP=false AllowRemoteRoot=true
gdmsetup
ssh root@somehost xauth list
somehost.somedomain/unix:10 MIT-MAGIC-COOKIE-1 d9fc3512df83a70ea8054dff21f58e28
su - someuser xauth add somehost.somedomain/unix:10 MIT-MAGIC-COOKIE-1 d9fc3512df83a70ea8054dff21f58e28