LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 05-24-2014, 07:07 AM   #1
postcd
Member
 
Registered: Oct 2013
Posts: 527

Rep: Reputation: Disabled
vnc server connection refused and port appears closed


I installed vncserver on my redhat, i installed same setup as i used on my last server where it worked.

But now after start vncserver and trying to connect it says "Connection refused"
I tried to check if port is open from external computer and it says its Closed.

I tried service iptables stop
and it still refused. Then i did iptables status and it shown some iptables things, so not sure if it was really stopped. so i added this rule to iptables: iptables -I INPUT -p tcp --dport 1 -j ACCEPT
my port is 1 of vnc.

but still refused. So i want to ask how to open that port? Or what to check?

the log file shows this:
Quote:
Failed to read: session.screen0.iconbar.iconWidth
Setting default value
Failed to read: session.screen0.iconbar.iconTextPadding
Setting default value
Failed to read: session.screen0.iconbar.usePixmap
Setting default value
Failed to read: session.screen0.titlebar.left
Setting default value
Failed to read: session.screen0.titlebar.right
Setting default value

Last edited by postcd; 05-24-2014 at 07:14 AM.
 
Old 05-24-2014, 07:10 AM   #2
GunFighT
Member
 
Registered: May 2014
Location: Romania
Distribution: Debian/Ubuntu, Rocky Linux
Posts: 53

Rep: Reputation: Disabled
can you post a output of you`re firewall ?

Quote:
iptables -vnL
and post a output from this command:

Quote:
ps -aux | grep vnc
 
Old 05-24-2014, 07:15 AM   #3
postcd
Member
 
Registered: Oct 2013
Posts: 527

Original Poster
Rep: Reputation: Disabled
iptables -vnL
Chain INPUT (policy ACCEPT 369 packets, 21993 bytes)
pkts bytes target prot opt in out source destination
4 240 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:1

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination

Chain OUTPUT (policy ACCEPT 205 packets, 17621 bytes)
pkts bytes target prot opt in out source destination

ps -aux | grep vnc
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.7/FAQ
root 5185 0.0 1.2 13616 6468 pts/0 S 17:10 0:00 Xvnc :1 -desktop vps.backup.com:1 (root) -httpd /usr/share/vnc/classes -auth /root/.Xauthority -geometry 1024x768 -depth 16 -rfbwait 30000 -rfbauth /root/.vnc/passwd -rfbport 5901 -pn
root 5192 0.0 0.2 4376 1540 pts/0 S 17:10 0:00 vncconfig -iconic
root 5222 0.0 0.1 3116 728 pts/0 S+ 17:13 0:00 grep vnc
 
Old 05-24-2014, 07:28 AM   #4
GunFighT
Member
 
Registered: May 2014
Location: Romania
Distribution: Debian/Ubuntu, Rocky Linux
Posts: 53

Rep: Reputation: Disabled
Anyway, you`re Chain INPUT default policy is ACCEPT. So you don`t need that rule anymore. But you can try connectiong to that vnc-server on ports 5900 and 5901, to see if the vnc-server changed the port.

You can also try a quick capture with wirethask (graphical), or tshark (console) to see if some traffic is commeing.
Hope you don`t have a gateway in front of the machine, that blocks all, or redirects via this macine you`re useing vnc-server (just saying).
 
Old 05-24-2014, 07:36 AM   #5
postcd
Member
 
Registered: Oct 2013
Posts: 527

Original Poster
Rep: Reputation: Disabled
thx, for solve this. Not sure why not at port 1 not, but at port 5901 it connected
 
Old 05-24-2014, 10:11 PM   #6
Doug G
Member
 
Registered: Jul 2013
Posts: 749

Rep: Reputation: Disabled
You configure the VNC server with display# not port#. Default VNC ports start at 5900, and since you won't be able to share display 0 (your console) the first normally used vnc port ends up being 5901.

You'll probably never use TCP port 1. http://en.wikipedia.org/wiki/List_of...P_port_numbers
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] vnc server used to work, suddenly stopped working with connection refused errors lpallard Linux - Software 2 02-23-2011 12:14 AM
VNC displays 'terminal window' that can't be closed after VNC connection to CentOS Hispacific Red Hat 1 10-15-2010 03:44 PM
Issue with vnc server "tightVNC: VNC server closed connection", due to Screensaver frenchn00b General 1 07-30-2009 06:55 AM
vnc port 5900 stubbornly closed osio Linux - Networking 2 12-15-2005 06:36 PM
VNC Connection refused pacman Linux - Software 7 08-08-2003 12:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 09:47 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration