What is the proper way to sudo over ssh?

Another way is to use the -t switch to ssh: ssh -t user@server “sudo script” See man ssh: -t Force pseudo-tty allocation. This can be used to execute arbi- trary screen-based programs on a remote machine, which can be very useful, e.g., when implementing menu services. Multiple -t options force tty allocation, even if ssh … Read more

proper way to sudo over ssh

Another way is to use the -t switch to ssh: ssh -t user@server “sudo script” See man ssh: -t Force pseudo-tty allocation. This can be used to execute arbi- trary screen-based programs on a remote machine, which can be very useful, e.g., when implementing menu services. Multiple -t options force tty allocation, even if ssh … Read more

How to run sudo with Paramiko? (Python)

check this example out: ssh.connect(‘127.0.0.1′, username=”jesse”, password=’lol’) stdin, stdout, stderr = ssh.exec_command( “sudo dmesg”) stdin.write(‘lol\n’) stdin.flush() data = stdout.read.splitlines() for line in data: if line.split(‘:’)[0] == ‘AirPort’: print line Example found here with more explanations: http://jessenoller.com/2009/02/05/ssh-programming-with-paramiko-completely-different/ Hope it helps!

How do I run my application as superuser from Eclipse?

You can follow these steps to compile/debug applications as superuser. Rename your java-application sudo mv /usr/lib/jvm/java-6-openjdk/jre/bin/java /usr/lib/jvm/java-6-openjdk/jre/bin/java.ori Create following script and store it as /usr/lib/jvm/java-6-openjdk/jre/bin/java #!/bin/bash # file: /usr/lib/jvm/java-6-openjdk/jre/bin/java # descr: Starter for jdk. Runs jdk as root when # cmd-line-arg “–run-as-root” is specified. # jre=”/usr/lib/jvm/java-6-openjdk/jre/bin/java.ori” run_as_root=false args= # Filter command-line argument for arg in … Read more