Contents
How to open xterm window and Run command in?
Most unixes and linux distributions provide xterm, but some old Fedora/RHEL/CentOS provide X without xterm, so it’s another dependency to think about. The command launched by xterm -e sudo — can then do the standard double-fork and setsid.
What happens if xterm is not on display?
If an option begins with a ” + ” instead of a ” – “, the option is restored to its default value. The -version and -help options are interpreted even if xterm cannot open a display, and along with the -class option, are checked before all other options.
What do I get when I run xterm through putty?
When I run xterm through putty (with X11 enabled) (from my host to the VM), I get: You may want to take a look at Xming, which provides the X window display server on your Windows host (you could also use Cygwin, for some it might be preferable).
How to run a sudo command in xterm?
The command launched by xterm -e sudo –… can then do the standard double-fork and setsid. Once the user has entered his password in the xterm, it goes away immediately, but your command runs in the background with elevated privileges. It can connect back to the original program using a socket or fifo to run as a root co-process.
How to use xterm-LS and-e simultaneously?
If you do want the effect of -ls and -e simultaneously, you may get away with something like xterm -e /bin/bash -l -c “my command here” Finally, -ls is not completely ignored, because xterm -ls -e does write a /var/run/wtmp entry (if configured to do so), whereas xterm -e does not.
How does xterm know which shell to run?
When xterm runs, it normally checks the SHELL environment variable for which shell to run. This shell can be changed, however, by providing a parameter to xterm, after all other options, which specifies the pathname of a shell to run.
Do you need a terminal to run Sudo in xterm?
I would suggest not to use xterm or gnome-terminal to provide a terminal for sudo, but to deal with the “sorry, you must have a tty to run sudo” message directly. There is a requiretty option in the sudoers file that makes sudo demand a terminal.
How to run a disown command in xterm?
The daemon or disown commands or similar might be useful if you want to wrap an existing application in a double-fork & setsid (eg, xterm -e sudo — daemon system-config-network or perhaps xterm -e sudo — bash -c “system-config-network & disown -a” ). Thanks for contributing an answer to Stack Overflow!
What happens when you enter password in xterm?
Once the user has entered his password in the xterm, it goes away immediately, but your command runs in the background with elevated privileges. It can connect back to the original program using a socket or fifo to run as a root co-process.