Skip to content
Ulrich Berntien edited this page Mar 22, 2019 · 1 revision

qsu

Name

qsu - launch sudo without requiring a tty.

Synopsis

qsu PASSWORD SUDO_ARGUMENTS

Description

qsu launchs sudo without requiring a tty. While sudo needs a tty for password input, qsu accepts the password as command line parameter. qsu uses an ASKPASS script to launch sudo without requiring a password input on tty.

The arguments are:

  • PASSWORD: The password of the current account. If the password contains special characters like $, then a quoting like 'secrect$password' to prevent a shell command line substitution could be needed.
  • SUDO_ARGUMENTS: The second argument and optional all other arguments are passed to the sudo command. The arguments could be sudo options.

Examples

To list the files in root:

$ qsu secrect ls -ls /root

To call qsu with special characters in the password:

$ qsu 'my password' cat /etc/shadow

To change the index.html file as user www also sudo options are possible:

$ qsu -u www cp index.html ~www/htdocs/index.html

Files

Attention: The password is stored in a script file in the $HOME directory. The file is removed after the sudo returns. While the sudo command runs the file with the password exists.

Clone this wiki locally