View previous topic :: View next topic |
Author |
Message |
carbon Guru


Joined: 27 Jun 2003 Posts: 455 Location: New York
|
Posted: Mon Jul 14, 2003 6:15 pm Post subject: noob question about setting up a server that routs |
|
|
hi,
i am wanting to setup a server which i can login remotely and do stuff like i am in front of it anywhere. i am using DSL btw.
i have a router and direct connection is always refused coz it is behind router, some of my rfriend told me you can get around it by setting up a server which i have no idea what is it all about.
i heard apache, ssh, blah blah blah. confuses me alot.
any place that explaint the basic of server or you can just go ahead and tell me what to do. any advice is welcomed.
thanks for reading. _________________ I do what I want, and that's what I do.
GNU World Domination
Carbon |
|
Back to top |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 55196 Location: 56N 3W
|
Posted: Mon Jul 14, 2003 6:34 pm Post subject: |
|
|
carbon,
You need to run sshd on the remote machine so that it will accept incoming ssh requests.
Your 'router' may do a lot more than just route. Network Address Translation (NAT) and firewalling perhaps?
You need to configure the router to forward port 22 to the remote machine or ssh packets will never reach it. (Your router/firewall will drop them)
Now you can log into it with the ssh command, as in
ssh -X <ipaddress>
or if you need to be a different user on the remote box
ssh -X -l <user> <ipaddress>
-X forwrds X protocol
-l is login
<user> is your user name on the remote box
<ipaddress> is the ip address of the remote machine, or the router, if the router does NAT.
See man ssh too.
By way of testing, you can run the server and client on the same pc then ssh 127.0.0.1 should open a secure connection to allow your pc to talk to itself on the network. It shows that ssh is set up OK
Regards,
Neddyseagoon _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
 |
carbon Guru


Joined: 27 Jun 2003 Posts: 455 Location: New York
|
Posted: Mon Jul 14, 2003 7:01 pm Post subject: |
|
|
how do you configure the router, mine is a netgear whatever, it has 4 ports
and i have hub too , just so i only need to get 1 line from downstairs to upstairs and computer upstairs can share the connection.
my future will place on downstairs tho.
haha sorry to make you read my decoration. _________________ I do what I want, and that's what I do.
GNU World Domination
Carbon |
|
Back to top |
|
 |
devon l33t

Joined: 23 Jun 2003 Posts: 943
|
Posted: Mon Jul 14, 2003 7:15 pm Post subject: |
|
|
carbon wrote: | how do you configure the router, mine is a netgear whatever, it has 4 ports |
Look in your Netgear install manual/CD for "forwarding", "port forwarding", "running services", etc. |
|
Back to top |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 55196 Location: 56N 3W
|
Posted: Mon Jul 14, 2003 8:55 pm Post subject: |
|
|
carbon,
With a bit of. luck, your router may already be managing your network.
Look in /etc/conf.d/net for a line that starts
#iface_eth0="dhcp"
If the '#' is missing your luck is in.
Set up the second PC the same way and plug it in. It should 'just work'.
Regards,
NeddySeagoon _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
 |
carbon Guru


Joined: 27 Jun 2003 Posts: 455 Location: New York
|
Posted: Mon Jul 14, 2003 11:03 pm Post subject: |
|
|
what about windows box?
i have a winxp machine that connect to the router thru a hub _________________ I do what I want, and that's what I do.
GNU World Domination
Carbon |
|
Back to top |
|
 |
carbon Guru


Joined: 27 Jun 2003 Posts: 455 Location: New York
|
Posted: Mon Jul 14, 2003 11:04 pm Post subject: |
|
|
what is a must in make menuconfig if it needs to work as a server?
ftp server for instance. _________________ I do what I want, and that's what I do.
GNU World Domination
Carbon |
|
Back to top |
|
 |
devon l33t

Joined: 23 Jun 2003 Posts: 943
|
Posted: Mon Jul 14, 2003 11:17 pm Post subject: |
|
|
carbon wrote: | what about windows box?
i have a winxp machine that connect to the router thru a hub |
What about your Windows box?
carbon wrote: | what is a must in make menuconfig if it needs to work as a server?
ftp server for instance. |
The kernel has to have basic TCP/IP support. From there, install a ftpd program like net-ftp/vsftpd. |
|
Back to top |
|
 |
carbon Guru


Joined: 27 Jun 2003 Posts: 455 Location: New York
|
Posted: Mon Jul 14, 2003 11:21 pm Post subject: |
|
|
i mean how does the windows box get around the router to have direct peer to peer connection available. _________________ I do what I want, and that's what I do.
GNU World Domination
Carbon |
|
Back to top |
|
 |
devon l33t

Joined: 23 Jun 2003 Posts: 943
|
Posted: Mon Jul 14, 2003 11:35 pm Post subject: |
|
|
carbon wrote: | i mean how does the windows box get around the router to have direct peer to peer connection available. |
You want the Windows box to talk to the Gentoo box and vice-versa? The Netgear has four ports, which is switched internally. So the Windows box and Gentoo box will communicate with one another without using the router. Can you not ping from the Gentoo <-> Windows? |
|
Back to top |
|
 |
carbon Guru


Joined: 27 Jun 2003 Posts: 455 Location: New York
|
Posted: Tue Jul 15, 2003 1:06 am Post subject: |
|
|
arrrr, ok the situation is this.
if my windows box is behind the router, people cannot send me file with ICQ.
but people that i know tells me that if i setup a server , then there will be way to get around this.
not sure if thats true.  _________________ I do what I want, and that's what I do.
GNU World Domination
Carbon |
|
Back to top |
|
 |
devon l33t

Joined: 23 Jun 2003 Posts: 943
|
Posted: Tue Jul 15, 2003 1:20 am Post subject: |
|
|
carbon wrote: | but people that i know tells me that if i setup a server , then there will be way to get around this.
not sure if thats true. |
Sure... They can upload the file to your server and then you can download it.
I would check out the manual for your Netgear about port forwarding. It would be prudent to make sure it is possible before diving into setting your own server. You may have to visit their website for more detail since the days of actually getting a manual rather than a piece of paper titled "Install Guide" are gone.  |
|
Back to top |
|
 |
carbon Guru


Joined: 27 Jun 2003 Posts: 455 Location: New York
|
Posted: Sun Jul 20, 2003 6:11 pm Post subject: |
|
|
i looked at the netgear http interface, it has a place where you configure port forwarding
if i want ftp and ssh to work, which port shall forward to which ip? _________________ I do what I want, and that's what I do.
GNU World Domination
Carbon |
|
Back to top |
|
 |
devon l33t

Joined: 23 Jun 2003 Posts: 943
|
Posted: Sun Jul 20, 2003 6:16 pm Post subject: |
|
|
ssh is tcp/22
ftp is tcp/21, tcp/20
Does the Netgear have a pre-defined FTP service option? I would use that. I am concerned that passive/active transfers between two firewalls (one at the end user and one at the server) may cause problems unless the firewalls are statefull.
You forward them to whatever IP has those services running.  |
|
Back to top |
|
 |
carbon Guru


Joined: 27 Jun 2003 Posts: 455 Location: New York
|
Posted: Sun Jul 20, 2003 7:50 pm Post subject: |
|
|
thanks!!
plus, i am running a text base ICQ on the gentoo machine.
what i want to do is, i can ssh to the machine and be able to continue to use my running text base icq. how to do that? _________________ I do what I want, and that's what I do.
GNU World Domination
Carbon |
|
Back to top |
|
 |
carbon Guru


Joined: 27 Jun 2003 Posts: 455 Location: New York
|
Posted: Sun Jul 20, 2003 7:56 pm Post subject: |
|
|
say my gentoo machine has ftp server and ssh server running
and the gentoo machine has an ip IP1
and my windows box has an ip IP2
so at the router port forwarding service, i make it forward port 22(ssh) to ip1 and port 21(ftp) to ip1?
what if i want port22 to be forwarded to my windows box too?
i guess this comes down to if ports arent explicitly forwarded, they will get dropped. is that right? _________________ I do what I want, and that's what I do.
GNU World Domination
Carbon |
|
Back to top |
|
 |
devon l33t

Joined: 23 Jun 2003 Posts: 943
|
Posted: Sun Jul 20, 2003 8:41 pm Post subject: |
|
|
Quote: | what i want to do is, i can ssh to the machine and be able to continue to use my running text base icq. how to do that? |
I used to do that with IRC and I still do when I connect to my Gentoo box from work to do some maintenance. I just ssh into it and then run any commands I want like I was at the console.
Quote: | what if i want port22 to be forwarded to my windows box too |
For ssh to the Windows box? Unless you get multiple IPs from your ISP, you can't. You have to have sshd on your Windows box listen on a different port than 22 (e.g. 2200) and then forward that port to your Windows box.
Quote: | i guess this comes down to if ports arent explicitly forwarded, they will get dropped. is that right? |
They should if your firewall is worth anything.  |
|
Back to top |
|
 |
carbon Guru


Joined: 27 Jun 2003 Posts: 455 Location: New York
|
Posted: Sun Jul 20, 2003 9:13 pm Post subject: |
|
|
regarding the ICQ thing, what i am trying to do is have icq running 24/7, and i can log into my gentoo box to "continue" to operate the running icq.
if i log on with ssh and open ICQ again, it wont do what i am trying to do.
any clue?
another question, if say my windows box also have a ssh server running, and i make it listen on port 9999, then i will have to forward port 9999 to my windows's ip right?
i understand why i only have 1 ip now, coz there is only 1 DSL modem. how to find out what is the ip that my ISP assigned me? plus if it was dynamic, how do i know what is my IP when i am not home? _________________ I do what I want, and that's what I do.
GNU World Domination
Carbon |
|
Back to top |
|
 |
devon l33t

Joined: 23 Jun 2003 Posts: 943
|
Posted: Mon Jul 21, 2003 2:38 am Post subject: |
|
|
Quote: | regarding the ICQ thing, what i am trying to do is have icq running 24/7, and i can log into my gentoo box to "continue" to operate the running icq. if i log on with ssh and open ICQ again, it wont do what i am trying to do.
any clue? |
Use screen. Screen allows to manage terminal screens (e.g. attach/detach from programs when moving). Startup the ICQ program with "screen -A -m -d -S icq /some/location/icq" and then do a "screen -r icq" to connect to that screen. Then do CTRL+A+D to disconnect when you leave for work/school and then do "screen -r icq" again to re-connect. "man screen" for more information.
Quote: | another question, if say my windows box also have a ssh server running, and i make it listen on port 9999, then i will have to forward port 9999 to my windows's ip right? |
Yes. You also have to tell ssh what port to use when connecting to the foreign host. ssh versus ssh -p <port>.
Quote: | i understand why i only have 1 ip now, coz there is only 1 DSL modem. how to find out what is the ip that my ISP assigned me? plus if it was dynamic, how do i know what is my IP when i am not home? |
To find out your current IP, you can go to www.whatismyip.com and see it there. If it changes a lot, you either need to write a script that notifies you of the new IP or use a dynamic DNS service. |
|
Back to top |
|
 |
carbon Guru


Joined: 27 Jun 2003 Posts: 455 Location: New York
|
Posted: Mon Jul 21, 2003 3:04 am Post subject: |
|
|
dynamic DNS service?
who provides that? does it cost money?? _________________ I do what I want, and that's what I do.
GNU World Domination
Carbon |
|
Back to top |
|
 |
devon l33t

Joined: 23 Jun 2003 Posts: 943
|
Posted: Mon Jul 21, 2003 3:12 am Post subject: |
|
|
carbon wrote: | dynamic DNS service?
who provides that? does it cost money?? |
I believe there are several companies, but I only know of one, DynDNS. And according to http://www.dyndns.org/services/pricing.html, it is free.
You may want to do a forum search looking for suggestions and/or post a message asking for some. I don't use a dynamic DNS service since my IP doesn't change that much and I run my own DNS.  |
|
Back to top |
|
 |
carbon Guru


Joined: 27 Jun 2003 Posts: 455 Location: New York
|
Posted: Mon Jul 21, 2003 1:14 pm Post subject: |
|
|
my netgear router http interface has a DNS service, is it possible that a dynamic DNS service is already built into the router?
plus, can i reach the http interface of the router or is it just seeable from within the LAN? _________________ I do what I want, and that's what I do.
GNU World Domination
Carbon |
|
Back to top |
|
 |
devon l33t

Joined: 23 Jun 2003 Posts: 943
|
Posted: Mon Jul 21, 2003 3:55 pm Post subject: |
|
|
Quote: | my netgear router http interface has a DNS service, is it possible that a dynamic DNS service is already built into the router? |
That allows your Netgear to notify your dynamic DNS service when your IP changes. I would consult your user's manual.
Quote: | plus, can i reach the http interface of the router or is it just seeable from within the LAN? |
It should be only accessible from the LAN side. You may be able to change that, but I would do so with extreme caution as it will allow others access to your configuration (assuming they get the password). |
|
Back to top |
|
 |
carbon Guru


Joined: 27 Jun 2003 Posts: 455 Location: New York
|
Posted: Mon Jul 21, 2003 5:15 pm Post subject: |
|
|
i emerged proftpd and when i try to ftp it with a ftp program, it starts at the home directory
/home/blah
and i can netvigate anywhere on the hard drive, and i wanna find out how to prevent that
can i setup a "root" folder which people connects thru the ftp port goes there and cannot go up a level? _________________ I do what I want, and that's what I do.
GNU World Domination
Carbon |
|
Back to top |
|
 |
carbon Guru


Joined: 27 Jun 2003 Posts: 455 Location: New York
|
Posted: Mon Jul 21, 2003 6:36 pm Post subject: |
|
|
one more question
does ping go thru a specific port as well? coz i cant ping my gentoo machine at home from work _________________ I do what I want, and that's what I do.
GNU World Domination
Carbon |
|
Back to top |
|
 |
|