Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Port problem
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
dudds
n00b
n00b


Joined: 03 Dec 2003
Posts: 28

PostPosted: Fri Feb 06, 2004 4:39 pm    Post subject: Port problem Reply with quote

I was trying to set Xvnc to run on port 21 instead of the default so that I can get a remote session to my Linux box from work. For some reason port 21 seems to the only one I can find that gets through our firewall. Anyways when I run the command Xvnc -rfbport 22 :4 as myself I get the following error message:

07/02/04 02:38:40 Xvnc version 3.3.7 - built Feb 5 2004 20:29:26
07/02/04 02:38:40 Copyright (C) 2002-2003 RealVNC Ltd.
07/02/04 02:38:40 Copyright (C) 1994-2000 AT&T Laboratories Cambridge.
07/02/04 02:38:40 All Rights Reserved.
07/02/04 02:38:40 See http://www.realvnc.com for information on VNC
07/02/04 02:38:40 Desktop name 'x11' (starbug:4)
07/02/04 02:38:40 Protocol version supported 3.3
07/02/04 02:38:40 Listening for VNC connections on TCP port 22
07/02/04 02:38:40 ListenOnTCPPort: Permission denied

However, when I run the same command as root I don't get any errors. What gives?? I guess I could just run as root, but I want to understand why I get the permission denied for port 21.

By the way if I don't specify a port and just use the default I don't have any problems at all.

Cheers,
Dave
Back to top
View user's profile Send private message
smart
Guru
Guru


Joined: 19 Nov 2002
Posts: 455

PostPosted: Fri Feb 06, 2004 5:10 pm    Post subject: Reply with quote

...
07/02/04 02:38:40 Listening for VNC connections on TCP port 22
...

While you obviously can write, you should practice reading ;)

Otherwise than that, the reason for port 21 being "open" is probably since it's usually used for ftp . With that purpose, it might actually be the case that there is an ftp roxy in between you and those port 21 instance in the outside world. In that case, it might be useless for your purpose. Give it a try, but don't bet too much on it....
Back to top
View user's profile Send private message
n0n
Guru
Guru


Joined: 13 Jun 2002
Posts: 355

PostPosted: Fri Feb 06, 2004 6:19 pm    Post subject: Re: Port problem Reply with quote

dudds wrote:
However, when I run the same command as root I don't get any errors. What gives?? I guess I could just run as root, but I want to understand why I get the permission denied for port 21.

UNIX systems have historically allowed only root to bind to ports<1024 for listening (or is that <=1024?). There's really no way around this, unless someone knows of some /proc setting or something that I don't know about. It's set up like that for security purposes.
Back to top
View user's profile Send private message
dudds
n00b
n00b


Joined: 03 Dec 2003
Posts: 28

PostPosted: Sat Feb 07, 2004 7:55 am    Post subject: Reply with quote

Hey smart thanks for the "smart"arse response. it was of absolutly no use. By the way I did and can read.
Back to top
View user's profile Send private message
alsaleha
n00b
n00b


Joined: 07 Feb 2004
Posts: 7
Location: Utah

PostPosted: Sat Feb 07, 2004 8:37 am    Post subject: Reply with quote

I'm not trying to start any flamewars, but I think you should practice what you preach smart

Quote:

07/02/04 02:38:40 Listening for VNC connections on TCP port 22
07/02/04 02:38:40 ListenOnTCPPort: Permission denied


dudds: n0n is correct, as a security measure, port 1024 and less can only be listened on with root permissions. can you run it as a daemon? if so, most daemons will start with root permissions, then give them up once they're listening on the necessary port.
_________________
I replaced an end-user with a shell script once:

#! /bin/bash

echo "will coffee hurt it?"

nobody noticed he was missing
Back to top
View user's profile Send private message
dudds
n00b
n00b


Joined: 03 Dec 2003
Posts: 28

PostPosted: Sat Feb 07, 2004 9:30 am    Post subject: Reply with quote

n0n and alsaleha thank's guys for your help. You've put me on the right track.

Cheers,
Dave
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum