[solved] stty bash script error: stdin: mismatched ioctl (2023)

tried Shell-Script wait here document

95.627

solution 1

x11vncexpects your standard input to be a terminal, and changes the terminal mode to avoid repeating the password as you type it. If standard input is not a terminal, thepigstyCalls to turn echo off and back on fail, hence the warning you see.

In fact, wait for a solution. Try this script (not tested):

#!/usr/bin/expect -fspawn x11vnc -storepasswd ~/.vnc/passwdexpect "password:" {send "swordfish" "\r"}expect "password:" {send "swordfish" "\r "} wait " Schreiben*\?" {send "y\r"}

Alternatively, if possible, use a non-RFB authentication method (-passwordor an SSL client certificate).

solution 2

Another way to avoid these warning messages is to runx11vncin a pseudo-terminal created by a UNIX command (seeUsing pseudo terminals (pty) to control interactive programs). that goes with meroad mapcommand or tools likepdip("Dialogue programmed with interactive programs").

Mac OS X 10.6.8 warning messages for the lack of a pseudo terminal forx11vnc:

# x11vnc 0.9.14sudo x11vnc -storepasswd ~/.vnc/passwd << ENDDOCpasswordpasswordyENDDOC# Enter the VNC password: stty: stdin is not a terminal## Confirm the password: # stty: stdin is not a terminal# Type the password to ~/ .vnc/senha? [y]/n Senha recorded in: ~/.vnc/passwd

solutions with theroad mapDomain:

# GNU-Skriptbefehleudo script -q -c 'x11vnc -storepasswd ~/.vnc/passwd' <<ENDDOC /dev/nullpasswordpasswordyENDDOC# ... oder ...printf '%s\n' 'contraseña' 'contraseña' 'y ' | sudo script -q -c 'x11vnc -storepasswd ~/.vnc/passwd' /dev/null# FreeBSD-Skriptbefehleudo script -q /dev/null x11vnc -storepasswd ~/.vnc/passwd <<ENDDOCcontraseñacontraseñayENDDOC

solution 3

sudo has an option-Sthis allows you to read the password from STDIN.

[[Email protected]~]$ tail -1 /etc/shadowtail: Cannot open `/etc/shadow' for reading: Access denied[[Email protected]~]$eco'[Email protected]!' | sudo -S cola -1 /etc/shadownfsnobody:!!:15891::::::

Here is an example script to demonstrate the process:

#!/bin/bashfunction hr { perl -e 'print "-" x 80, "\n";'} hrread -p "Bitte geben Sie Ihr sudo-Passwort ein: " -s sudopasswdechohrecho "-sudo run: tail - 1 /etc /shadow"tail -1 /etc/shadowhrecho "+sudo run: tail -1 /etc/shadow"echo "$sudopasswd" | sudo -S tail -1 /etc/shadowhrecho "-sudo execute: ls -la /root/"ls -la /root/hrecho "+sudo execute: ls -la /root/"echo "$sudopasswd" | sudo -S ls -la /root/hr

Your script would simply need to do something like this:

read -p "Please enter your password sudo: " -s sudopasswdecho "$sudopasswd" | sudo -S x11vnc -storepasswd ~/.vnc/passwd

This allows you to use sudo commands in your script without having to hardcode a password.

Alternatively, you could give your user or a subset of users the ability to run x11vnc with sudo without a password, but add a line like this/etc/sudoers:

Benutzer ALL= ( root ) NOPASSWD : /route / a / x11vnc

or create onevncusersGroup, add users to this group and add the following/etc/sudoers:

%vncusers ALL=(root) NOPASSWD: /ruta/a/x11vnc

To share:

95.627

Similar videos on Youtube

[solved] stty bash script error: stdin: mismatched ioctl (1)

04:20

Unix and Linux: stty bash script error: stdin: bad ioctl for device

Roel van de Paar

(Video) Creating and Formatting Partitions with FDISK and mkfs - BASH - Linux

696

[solved] stty bash script error: stdin: mismatched ioctl (2)

01:17

How to avoid error stty: 'std input': ioctl incompatible with device?

Roel van de Paar

72

[solved] stty bash script error: stdin: mismatched ioctl (3)

04:13

Arduino: ioctl inappropriate for the device (4 solutions!)

Roel van de Paar

27

[solved] stty bash script error: stdin: mismatched ioctl (4)

01:40

Unix and Linux: channel to adopt: stty: stdin: inappropriate ioctl for the device (2 solutions!)

Roel van de Paar

(Video) How to use the lslogins command: 2-Minute Linux Tips

21

[solved] stty bash script error: stdin: mismatched ioctl (5)

01:53

Should I try removing "inappropriate device ioctl" in the strace output to a bash script?

Roel van de Paar

18

[solved] stty bash script error: stdin: mismatched ioctl (6)

author of

Jarek

You may be interested in the story of SE presenter Monica Cellio and how she was treated unfairly by the administration of this site. More information here. An update is available. Hopefully, we can create a fairer environment for content creators and moderators in the future.

Updated September 18, 2022

Comments

  • [solved] stty bash script error: stdin: mismatched ioctl (7)

    Jarek 4 fun

    I'm using here-documents in a bash script to automate installation and configuration, which often require a password. I type the password once and the script passes it to various commands. In most cases this is easily handled with the document approach here. However, in one case I get this error:

    Enter VNC password: stty: stdin: ioctl not supported by device Verify password: stty: stdin: ioctl not supported by device

    Please note that this error message comes fromx11vnc save password(Do not givesudo.)

    my problem is related tox11vnc -storepasswdand here is my code:

    sudo x11vnc -storepasswd ~/.vnc/passwd << ENDDOCsenhasenhasENDDOC

    This obviously doesn't work (because of the bug). I would appreciate a working example of the implementation.sudo x11vnc -storepasswd ~/.vnc/passwdin a script.

    If it helps, the prompts look like this:

    Enter the VNC password:
    Confirm password:
    Write the password to /home/user/.vnc/passwd? [yes]/n

    It is usedwaitbe a better solution? If so, how would I use it in this case? (never usedwaitbefore, but I've seen a lot of examples since I asked this question and I can't seem to figure them outwaitworking alone.)

    (Video) Unix & Linux: bash: cannot set terminal process group (-1): Inappropriate ioctl for device

  • [solved] stty bash script error: stdin: mismatched ioctl (8)

    Jarek more than 9 years

    Thank you. However, the error does not come fromsudocomes fromx11vnc save password.

  • [solved] stty bash script error: stdin: mismatched ioctl (9)

    Jarek more than 9 years

    Thank you. However, the error does not come fromsudocomes fromx11vnc save password. I have tried differentwaitIt's getting closer and I can't hit it. an example withwaitto enter a passwordx11vnc save passwordIt would be greatly appreciated. I'll update my question to avoid further confusion.

  • [solved] stty bash script error: stdin: mismatched ioctl (10)

    Gilles 'So stop being mean' more than 9 years

    @MountainX Correct, sorry I misunderstood the question. Here's an expectation script (totally untested).

  • [solved] stty bash script error: stdin: mismatched ioctl (11)

    Jarek more than 9 years

    Thank you so much. Your untested script gave me some additional clues, but ultimately it doesn't work perfectly either. the mistake is simpleEnter the VNC password: Usage: Send the string [args].On the lineExpecting "Password:" {send "Swordfish" "\r"}. I'm not sure how to fix this. Expect seems to be a very demanding tool because I've been struggling with this particular problem for hours with no results so far.

  • [solved] stty bash script error: stdin: mismatched ioctl (12)

    Jarek more than 9 years

    The error (previous comment) came fromsend "fish-sword" "\r"and it was solved bysend "fish-sword\r". However, the solution still doesn't work. No passwords are written to ~/.vnc/passwd. I still don't know why. Like I said, I've seen this result despite trying everything I can think of so far.

  • [solved] stty bash script error: stdin: mismatched ioctl (13)

    Jarek more than 9 years

    By the way, the same commands used in yourwaitWork solution with manual input. they don't work on itwaitscript or any variation of it that you have tried so far.

  • [solved] stty bash script error: stdin: mismatched ioctl (14)

    (Video) Shell Scripting for DevOps | Zero 2 Hero Part-2 | Shell Scripting Interview Q&A | #devops

    alper more than 2 years

    I have the following error:spawn: command not found, line 3: expected: command not foundshould i insert?.zshrcArchive?

  • [solved] stty bash script error: stdin: mismatched ioctl (15)

    Gilles 'So stop being mean' more than 2 years

    @alper This is a wait script, not a shell script. You have to put the code in a file, make it executable and run it. And you need to installwait.

newer

Why is a PNG drop shadow grainy in Flutter web app?

How to fix crashes detected by Google Play Store for Flutter app

Cupertino DateTime Picker stops scrolling behavior

Why does awk -F work for most letters but not the letter "t"?

Flutter change hover color and icon color but not working

How do I print to USB using Flutter Desktop and connect to the printer?

Critical issues have been reported with the following SDK versions: com.google.android.gms:play-services-safetynet:17.0.0

Flutter Dart: get localized country name from country code

navigatorState é nulo ao usar pushNamed Navigation onGenerateRoutes de GetMaterialPage

Android SDK Manager Not Found - Flutter Doctor Error

Flutter Laravel push notification without using third parties like (Firebase, Onesignal, etc.)

How to change color of ElevatedButton when entering text in TextField

(Video) what is a tty? (beginner - intermediate) anthony explains #022

Videos

1. Arduino: Inappropriate ioctl for device (4 Solutions!!)
(Roel Van de Paar)
2. Terminal vs Console vs Shell : tty, bash... - #Linux 1.3
(xavki)
3. stty settings are pathologically altered
(Roel Van de Paar)
4. standard input output redirection in linux | pipe in linux | stdin, stdout & stderr stream in linux
(Pedagogy)
5. What Happens In a "Shell Upgrade"?
(0xdf)
6. HackTheBox - OpenAdmin
(IppSec)

References

Top Articles
Latest Posts
Article information

Author: Aron Pacocha

Last Updated: 09/08/2023

Views: 6312

Rating: 4.8 / 5 (68 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Aron Pacocha

Birthday: 1999-08-12

Address: 3808 Moen Corner, Gorczanyport, FL 67364-2074

Phone: +393457723392

Job: Retail Consultant

Hobby: Jewelry making, Cooking, Gaming, Reading, Juggling, Cabaret, Origami

Introduction: My name is Aron Pacocha, I am a happy, tasty, innocent, proud, talented, courageous, magnificent person who loves writing and wants to share my knowledge and understanding with you.