LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   TightVNC on Slackware 12.2 ??? (https://www.linuxquestions.org/questions/slackware-14/tightvnc-on-slackware-12-2-a-699603/)

phys 01-24-2009 10:47 AM

TightVNC on Slackware 12.2 ???
 
Hi Slackers;

I have downloaded and installed TightVNC from slackbuils.
I want to establish graphical desktop connection between two Slackware machines (Slack_1 and Slack_2) attached to the same DSL router.

Slack_1 ----------> Slack_2 (Target Machine)

First I started the "vncserver" and did password settings on Slack_2, then started "vncviewer" on Slack_1 and entered IP Adress of Slack_2 (192.168.2.4) assigned by DSL Router on a dialog box. But I could not establish connection with Slack_2.

Code:

hzyss@slackware:~$ vncviewer
vncviewer: ConnectToTcpAddr: connect: Connection refused
Unable to connect to VNC server
hzyss@slackware:~$

What can cause this problem?

Ilgar 01-24-2009 11:02 AM

What about the port settings?

phys 01-24-2009 11:21 AM

Quote:

Originally Posted by Ilgar (Post 3419831)
What about the port settings?

These machines are at home and connected to internet on the same DSL router. I do not know how to configure port settings. I looked for port settings, but I was not able to find. How can I do? Using router graphical interface or another way?

Alien Bob 01-24-2009 12:09 PM

On Linux, a vncserver can not use the port that X Window already uses. It will open a port one number higher if that is available (and otherwise keeps incrementing until it does find an unused port number).
So, your vncviewer will have to connect to "192.168.2.4:1" in order to find the vncserver.

Eric

Ilgar 01-24-2009 12:36 PM

Alien, isn't what you're referring to "screen" or "display" rather than port? Besides, VNC shouldn't open a new display, it should allow the remote control of the existing one. In case of VNC client, the 192.168.2.4:1 means port #1, but of course it's in the reserved range.

Phys, the VNC server on the target machine should be listening a certain port number. You can check the manpages of the server software to see where to configure it. Then you can connect to ipnumber:port (e.g. 192.168.2.4:1234).

Ilgar 01-24-2009 12:42 PM

Ack, you're right Alien, ip:num is also interpreted as ip:display (so obviously :1 is supposed to mean display #1). I've used TightVNC many times before, but always for remote connection to remote Windows hosts. Apparently there are other options when you have a Unix host.

phys 01-24-2009 02:47 PM

Thank you very much ilgar and Eric. Trying "192.168.2.4:1" and "192.168.2.4:2" worked. Maybe I started "vncserver" two times. :) Now I can connect to Slack_2.

Tomorrow, I am going to try to connect to Slack_1 from outside of my local home network. Internet provider assigns IP dynamically for my home network. This time what procedure am I going to follow? Is it enough to learn IP of Slack_1 from "http://www.showmyip.com/" and following the same procedure as you mentioned above?

Alien Bob 01-24-2009 07:00 PM

Depends on whether you are port-forwarding the VNC portnumber. If you don't do port-forwarding there is no way you can access that vncserver from the internet.
Also I would strongly advise against trying that, because the VNC protocol is unencrypted and the passwords you type are transmitted in the clear - any one can sniff them out.

Eric

phys 01-25-2009 05:21 AM

Quote:

Originally Posted by Alien Bob (Post 3420215)
Depends on whether you are port-forwarding the VNC portnumber. If you don't do port-forwarding there is no way you can access that vncserver from the internet.
Also I would strongly advise against trying that, because the VNC protocol is unencrypted and the passwords you type are transmitted in the clear - any one can sniff them out.

Eric

Thanks for your advise, Eric. You say that VNC transfers passwords between viewer and server without encryption. That is very insecure. Maybe creating a user account for that purpose and running server on this user provide a little bit security. If someone connects to my computer over the internet solving VNC server password controlling the VNC's insecure password transfer protocol, can he/she obtain the control of outside the user home directory on Slackwae without knowing root password? (Root password is strong enough.)

Ilgar 01-25-2009 05:45 AM

He shouldn't be able to do that. Nevertheless, it would probably increase the risk.

Since you're trying to connect to a LAN computer, the speed of connection should be quite high. Do you really need VNC? You may consider ssh with X11 forwarding for example.

phys 01-25-2009 06:37 AM

Thank you ilgar;
Quote:

Do you really need VNC?
I want to make a graphical desktop connection with another Linux machine. If something does this, no matter what program it is.
Quote:

You may consider ssh with X11 forwarding for example.
I use ssh for connecting an AIX server user account. Is it possible to start user's X session using SSH? I login to server only in a terminal view.

Ilgar 01-25-2009 07:17 AM

Do you need the entire desktop environment running? If not, that is, if you only want to be able to run graphical software remotely, SHH + X11 forwarding will do. For remote connections over the internet, speed might be an issue (of course, VNC isn't fast either) but at least with a LAN connection shh + x11 should work with no noticeable lag.

To enable this, on the ssh server side, you should enable X11 forwarding with the line

Code:

X11Forwarding yes
in sshd_config (usually under /etc/shh) -- don't forget to restart the service for the change to take effect.

On the client side, you can use the -X option to request X11 forwarding (i.e. ssh -X user@host). You can make X forwarding request the default by putting the line

Code:

ForwardX11 yes
in ssh_config (not to be confused with sshd_config). Then you don't need to use -X.

phys 01-25-2009 08:08 AM

I am going to try "SSH X11 forwarding method" applying your instructions, Ilgar. I understood how I can connect to a server account from my home (ssh -X user@host), but there is still problems in my mind about how I can connect to network at home from outside. What will I type for host domain name of my home network? Does "ssh -X user@IP_Number" work? I do not know how an server OS and ordinary OS differ from each other.

mrclisdue 01-25-2009 09:14 AM

Yes,

Code:

user@ip_address
will work.

You may want to look into one of the dynamic address services, like dyndns.org, no-ip.com, amongst others. These services allow you to run a small client app on your machine which will update your external ip address, and allow you to reach your system with an address like:

Code:

phys.myvnc.com
, and many others.

You may also consider connecting to vnc through an ssh tunnel. Along the lines:

Code:

ssh -L 5900:localhost:5900 user@<your_home_machine>
and then connecting:

Code:

vncviewer localhost:5900
I hope I haven't muddied the waters for you, just providing options.

cheers,

Ilgar 01-25-2009 09:17 AM

I don't quite get what the problem is -- you use the user@ip format regardless of whether it's a LAN or internet connection. In your case you have 2 computers on the same LAN.

To have X forwarding, the ssh server (i.e. the one on the target computer) must be configured to allow X11 forwarding. This you do by modifying sshd_config. To see how it works, you may even test it on your computer by connecting to localhost (i.e. ssh user@localhost).


All times are GMT -5. The time now is 01:50 PM.