

- INAPPROPRIATE LOCTL FOR DEVICE UNRARX HOW TO
- INAPPROPRIATE LOCTL FOR DEVICE UNRARX MAC OS X
- INAPPROPRIATE LOCTL FOR DEVICE UNRARX PASSWORD
Your script, would simply need to do something like: read -p "Please enter your sudo password: " -s sudopasswdĮcho "$sudopasswd" | sudo -S x11vnc -storepasswd ~/.vnc/passwd Read -p "Please enter your sudo password: " -s sudopasswdĮcho "$sudopasswd" | sudo -S tail -1 /etc/shadowĮcho "$sudopasswd" | sudo -S ls -la /root/ Here is an example script to demonstrate the process: #!/bin/bash echo mode) on a file descriptor that was no terminal (but, say, a regular file), hence ENOTTY. It used to be triggerred primarily by attempts to configure terminal properties (e.g. Tail: cannot open `/etc/shadow' for reading: Permission ~]$ echo | sudo -S tail -1 /etc/shadow 'inappropriate ioctl for device' is the error string for the ENOTTY error. Sudo has an option -S that allows it to read the passwd from STDIN. Sudo script -q /dev/null x11vnc -storepasswd ~/.vnc/passwd < # Write password to ~/.vnc/passwd? /n Password written to: ~/.vnc/passwd # Enter VNC password: stty: stdin isn't a terminal Sudo x11vnc -storepasswd ~/.vnc/passwd << ENDDOC The warning messages on Mac OS X 10.6.8 for not providing a pseudo-terminal for x11vnc: # x11vnc 0.9.14 This can be done with the script command or tools such as pdip ("Programmed Dialogue with Interactive Programs"). Will using expect be a better solution? If so, how would I use it in this case? (I have never used expect before but I have looked at a lot of examples since posting this question and I cannot get expect to work on my own.)Īnother option to avoid those warning messages is to execute x11vnc in a pseudo-terminal created by a UNIX command (see Using pseudo-terminals (pty) to control interactive programs). Write password to /home/user/.vnc/passwd? /n n In case it helps, the prompts look like this: I would appreciate a working example of how to implement sudo x11vnc -storepasswd ~/.vnc/passwd in a script. That obviously (from the error) does not work. My problem is related to x11vnc -storepasswd and here's my code: sudo x11vnc -storepasswd ~/.vnc/passwd << ENDDOC Please notice that this error message is from x11vnc -storepassword (not from sudo.) Stty: standard input: Inappropriate ioctl for device However, in one case I get this error: Enter VNC password: stty: standard input: Inappropriate ioctl for device In most instances the here-document approach handles this fine. I enter the password once and the script passes it to the various commands. I can't help you any further, but perhaps this old answer about a similar problem offers some clues.I'm using here-documents in a bash script to automate installation and setup where a password is required many times. This suggests a bug in your shell startup scripts, which are doing something that is inappropriate when run "non-interactively", causing you to get this error even though you are running commands connected to a terminal. First something tried to do something terminal-related and failed, and then stty ran successfully. The tcsetattr error is not coming from stty. Tcsetattr: Inappropriate ioctl for device Stty: 'standard input': Inappropriate ioctl for deviceīut what you are getting is $ ssh -tt yourserver stty < /dev/null This is what I get when I run these commands with my servers: $ ssh myserver stty < /dev/null Now, the whole point of the -tt option to ssh is to guarantee that the program run on the remote host is connected to a terminal, and stty printing out speed 38400 baud line = 0 -brkint -imaxbel demonstrates that it was. (I know this because tcgetattr is the name of a C library function that does terminal control operations.) Tcgetattr: Inappropriate ioctl for device normally means that some program attempted to do a terminal control operation but its standard I/O streams weren't connected to a terminal.INAPPROPRIATE LOCTL FOR DEVICE UNRARX PASSWORD
INAPPROPRIATE LOCTL FOR DEVICE UNRARX MAC OS X
INAPPROPRIATE LOCTL FOR DEVICE UNRARX HOW TO