# remotly connecting to my system??

## 118947

Hi! I've tried searching, but as my scenario is quite complex (I think) I'll just post my question:

Here's the scenario:

I want to be able to connect to my PC (A)  that stands in location A from location B (200Km apart) using another computer (B).

I want to be able to acess A's files, maybe 'remotely' mount a certain partiton, and also be able to controll X (manipulate running programs such as Amule...).

The reason for this is quite simply, that although both PCs have access to a broadband connection, only one PC (A) is able to use Filesharing tools (Amule), and I want to transfer completed files to my second PC (B) and add/remove new downloads to/from my list.

My question is, what tools will I need to install and how do I need to configure them to allow me to connect to PC (A) which is behind a router which itself is given a random IP from the ISP.

Any help or pointers to those HOWTO'S is most welcome   :Wink: 

----------

## matttah

Well here is just a rough idea.  You can have the router fowards a port to your computer.  Then, you said  it is randomly given an ip.  So have your computer upload your ip to a webpage hourly or however often your ip changes on that machine.  Then you can just use ssh/scp to transfer the files between machines and to manipulate the running machiine.

Daum

----------

## xenoscr

You could setup an NFS share to be able to move files back and forth. You can use VNC to remotely control your desktop, I recoment x11vnc for the server since it can take over an existing X session.  You could also use ssh and scp for quick file copying and remote administration.

XeNoSCR

----------

## krolden

 *xenoscr wrote:*   

> You could setup an NFS share to be able to move files back and forth.

 

Isn't it generally a bad idea to allow NFS over the Internet?  I heard that you need to allow a lot of inbound connections in order to get it working.

----------

## 118947

first, thanX for the ideas!

 *Quote:*   

> Isn't it generally a bad idea to allow NFS over the Internet?

 

Security is of course also a point which I need to take into consideration. Anything more detailed on that anyone?

 *Quote:*   

> You can have the router fowards a port to your computer.

 

So that once I know the current IP address of computer (A)'s network I can gain access to computer (A) itself through the forwarded port? 

 *Quote:*   

> So have your computer upload your ip to a webpage hourly or however often your ip changes on that machine

 

Are there 'useRable' tools availible to achieve this?

Also, can you (I know I could search myself...) point me to a thorough howto on the matter(s)?

ThanX again!   :Smile: 

----------

## Monkeh

Just get a domain from http://www.dyndns.com/ (it's free), and then grab an updater and have it start on boot (via /etc/conf.d/local). I use inadyn myself, it's on the site under third party. My config:

```
username *snip*

password *snip*

alias monkeh.gotdns.org

update_period_sec 1800

verbose 5

log_file /var/log/inadyn.log

background

change_persona 65534:65533
```

----------

## 118947

 *Quote:*   

> ust get a domain from http://www.dyndns.com/ (it's free), and then grab an updater and have it start on boot (via /etc/conf.d/local). I use inadyn myself, it's on the site under third party

 

Ok, i've setup my domain, now to this updater.

inadyn doesn't seem to be availible through portage, Updatedd is though, but I'm not shure how I have to run it, so that it runs in the background and updates my ip say every halfhour.

I downloaded inadyn but the it refuses to run, just says permission denied. Does my user need to be in a special group or something?

 :Question: 

----------

## xenoscr

 *Krolden wrote:*   

>  *xenoscr wrote:*   You could setup an NFS share to be able to move files back and forth. 
> 
> Isn't it generally a bad idea to allow NFS over the Internet?  I heard that you need to allow a lot of inbound connections in order to get it working.

 

Yeah, prolly not the smartest way. I personally use ssh, scp, sftp, and VNC through a ssh tunnel to remotely administer my computers.

XeNoSCR

----------

## 118947

 *Quote:*   

> I personally use ssh, scp, sftp, and VNC

 

Where do I need to start looking for infos on how to set that up

Anything else I need to know before I start?

Also, how can I test that my setup is working correctly. I know I can just use my second computer and try to connect to the first (1step)

but how can I see that I am able to connect to it from 'outside' of my router's network, without driving 200km just to find out, that it doesn't work?

----------

## krinn

You have many solves to your problem

1/ Instead of amule, mldonkey is a client/server filesharing program, that means, server can run in a computer & client on another one (even from another OS or from a browser)

2/ Using ssh to access computer A will gave you ability to handle that computer (best solve)

3/ Using vnc (already present if you use gnome) or tightvnc will gave you ability to handle it again from any other OS

And for the next part of your question:

You need a dynamic ip service to have a dynamic IP on computer A so computer B can find it on internet

Many exists (no-ip, dyndns...) & some programs are in portage to handle that.

as a sample:

emerge noip-updater

is the tool to update your dynamic ip from www.no-ip.com

----------

## m.b.j.

updatedd ist a good update tool to, and it's available in portage

supports many services (including no-ip.com & dyndns)

----------

## Monkeh

 *hungrigerhaifisch wrote:*   

>  *Quote:*   ust get a domain from http://www.dyndns.com/ (it's free), and then grab an updater and have it start on boot (via /etc/conf.d/local). I use inadyn myself, it's on the site under third party 
> 
> Ok, i've setup my domain, now to this updater.
> 
> inadyn doesn't seem to be availible through portage, Updatedd is though, but I'm not shure how I have to run it, so that it runs in the background and updates my ip say every halfhour.
> ...

 

No, you need to give it execute permissions. Drop it in /usr/local/bin, and chmod +x it. Then add it to /etc/conf.d/local.start and local.stop, and away you go (you'll need to use start-stop-daemon for local.stop, check the man page). My config there checks for a different IP every half hour, so just drop in your user and pass.

----------

## xenoscr

 *hungrigerhaifisch wrote:*   

>  *Quote:*   I personally use ssh, scp, sftp, and VNC 
> 
> Where do I need to start looking for infos on how to set that up
> 
> Anything else I need to know before I start?
> ...

 

Read the ssh, scp, and sftp man files to get an idea how they work. On Gentoo ssh is pretty much ready to go, you just need to start it. (/etc/init.d/sshd) I would recommend at the very least disabling root login by uncomment the line

```

PermitRootLogin no

```

There is more information on configuring ssh here http://www.gentoo.org/proj/en/infrastructure/config-ssh.xml

To create a ssh tunnel you use the following command:

```

ssh user@server -L localport:localhost:remoteport

```

So, for a vnc tunnel on the default port, you would issue the following command:

```

ssh user@foo.bar.com -L 5900:localhost:5900

```

Then in your vnc client connect to localhost on port 5900. Now, if youre running vnc on the computer you are creating the tunnel from you will need to specify a different local port for your tunnel.

Hope this helps some.

XeNoSCR

----------

## 118947

Thank you all for your help/ideas

Now all I need is enough time to get things working. I`ll post my progress!

 :Very Happy: 

----------

