SlackwareThis Forum is for the discussion of Slackware Linux.
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.
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:~$
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?
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.
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 ipnumberort (e.g. 192.168.2.4:1234).
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.
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?
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.
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.)
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.
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.
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.
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:
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).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.