New answers tagged

2

For the cases where it "works", you are leaving a process running cat which is reading its standard input, which has not been closed. Since that is not (yet) closed, cat continues to run, leaving its standard output open, which is used by the shell (also not closed).


0

The best option is use Sudo rulles Safe passwords in text file is in top 10 wrong pratice IT. but if you want use you must rememebr parwd is not read from stdin but ftom tty so you can use expect(*1) but this is still wrong way . Beter option is use sudo or sshkey you can login to ssh account using public key to localhost address . do not try su - ...


0

Typically programs like su require passwords to be entered on the terminal and can't be bypassed. The root user doesn't need to enter a password to switch to another, so it's common to see solutions like sudo su user. However we might be able to cheat. If you have the expect command on your system then we can fake typing the password #!/usr/bin/expect -f ...



Top 50 recent answers are included