ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi, i'm doing a fork() on my program, while my
child process does a ssh tunneling then parent process
doing vncviwer. when i run my program, my console will
output the result of ssh and then go to the prompt to the
machine that be tunneled. I want to block the user input
so that users can do nothing on my console after i run
my program. What should i do?
so u want to not even be able to type? i guess you could mess with the termios settings and disable character echoing. however, the above method, even though you can still type, the input isn't going to be read. i guess that isn't good enough though? check out 'man termios'
let me clarify my question: in my child process generated by fork(), i'm going to do
a execl() for executing ssh to login into a remote machine. I was trying to block/disable
the user input after login into the remote machine, say the user can't input at the prompt
of the remote machine. So how can i do that?
ssh -n did work, but after i logged in by execl("...ssh",....), the format of the text on screen was in a mess, like the following:
rem@domrep:~$ VNC server supports protocol version 3.3 (viewer 3.3)
No authentica tion needed
Desktop name "nobody's x11 desktop (uml1:1)"
Connected to VNC server, using protocol version 3.3
VNC server default format:
32 bits per pixel.
Least significant byte first in each pixel.
True colour: max red 255 green 255 blue 2 55, shift red 16 green 8 blue 0
Warning: Cannot convert string "-*-helvetica-bold -r-*-*-16-*-*-*-*-*-*-*" to type FontStruct
Using default colormap which is TrueC olor. Pixel format:
16 bits per pixel.
Least significant byte first in each p ixel.
True colour: max red 31 green 63 blue 31, shift red 11 green 5 blue 0
Usin g shared memory PutImage
Same machine: preferring raw encoding
ShmCleanup called
jimmy@linux:~> jimmy@linux:~> jimmy@linux:~> jimmy@linux:~> jimmy@linux:~> jimmy@linux:~> jimmy@linux:~> jimmy@linux:~> jimmy@linux:~> jimmy@linux:~> jimmy@linux:~> jimmy@linux:~> jimmy@linux:~> jimmy@linux:~> jimmy@linux:~>
jimmy@linux:~> jimmy@linux:~>
i'm still not satisfied with the result, 'coz after i close vnc and the console itself terminate
the ssh connection, the format of the prompt and input became messy as you saw it on
my previous post. Say, when you press ENTER, the next prompt should appear on the next
line, not just a space away following the prior one.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.