maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Newbie (https://talk.maemo.org/forumdisplay.php?f=26)
-   -   ssh usage (https://talk.maemo.org/showthread.php?t=19515)

iliaden 2008-04-24 21:39

ssh usage
 
hi,

I am lost, and beg you for help!

on my n800, I have installed ssh (client), and on the desktop (windows 2000, cygwin), ssh server. The server works perfectly, and I was able to connect to it via another computer on my network.

the question is: how to connect to my desktop via ssh? I have no wireless router (living off my neighbor's connection... don't tell them!:D), so the network I am on and the one i'm trying to connect to are different. How do I do this?

thank you

Ilia

ace 2008-04-24 21:58

Re: ssh usage
 
You'll have to go over the internet, so your wired router will need to forward the ssh port to your desktop.

iliaden 2008-04-24 22:06

Re: ssh usage
 
request for aditional clarification:
1-WHICH port???
2- from the n800, i enter
$ssh -X login@???
I have a program that sends my IP to a server every 5 minutes, thus giving me a static address. do i enter
$ssh -X login@my.external.ip.?
ex: currently: 216.221.38.161

if that's it, then what port should I enter (after having opened it on my firewall)?

ace 2008-04-24 22:33

Re: ssh usage
 
Default ssh port is 22.

jldiaz 2008-04-24 22:56

Re: ssh usage
 
Quote:

Originally Posted by iliaden (Post 174295)
on my n800, I have installed ssh (client), and on the desktop (windows 2000, cygwin), ssh server. The server works perfectly, and I was able to connect to it via another computer on my network.


This "other computer on your network" is wired to your W2000? It is a local network? Did you use an internal IP to connect?

Quote:

Originally Posted by iliaden (Post 174295)
the question is: how to connect to my desktop via ssh? I have no wireless router (living off my neighbor's connection... don't tell them!:D), so the network I am on and the one i'm trying to connect to are different. How do I do this?

You need to provide your external IP to the ssh client. YOu can find this IP in your W2000 box by typing the command ifconfig in a cmd window. If the IP you obtain is not what you expected, (i.e, you get another internal IP), then probably your router has the "true" external IP,and you have to setup your router to forward the port 22 to your W2000 machine.

You dont need to specify any port in the ssh client command line, as long as your ssh server uses the standar port (which is 22, as said).

iliaden 2008-04-24 22:59

Re: ssh usage
 
thanks... although ace gave me the answer I needed.
All I was missing was the port number, so when trying to connect, it was closed.
I have a small program that gives me a static ip (see www.no-ip.com). therefore, I always connect to user@staticIP.com

the W2k is the machine i tried (and finally did!) connect to. It has cygwin to allow this.

Ilia

iliaden 2008-04-24 23:03

Re: ssh usage
 
although I have another question:
now that I have ssh connection working, is there any way to make two computers work together.

I'll be more specific: I need to send a file from the host (w2k) to the client (n800). Can I use cp? if so, what would it be?
$ cp /cygdrive/*/folder/file.ext /???
where do I copy it?

thank you.

desiv 2008-04-24 23:12

Re: ssh usage
 
Quote:

Originally Posted by iliaden (Post 174346)
I'll be more specific: I need to send a file from the host (w2k) to the client (n800). Can I use cp? if so, what would it be?
$ cp /cygdrive/*/folder/file.ext /???
where do I copy it?

thank you.

You don't send to file from the host to the n800.
You get the file using your n800.

So, you'd use something like (from the n800 shell):
scp user@my.external.ip:/path/to/file ./

Or you can use sftp....

desiv

jldiaz 2008-04-24 23:15

Re: ssh usage
 
Quote:

Originally Posted by iliaden (Post 174346)
I'll be more specific: I need to send a file from the host (w2k) to the client (n800). Can I use cp? if so, what would it be?
$ cp /cygdrive/*/folder/file.ext /???
where do I copy it?

The required command is scp, to be issued in the tablet. It does not require the ssh session previously stablished. scp works similar to cp, only one of the files (source or destination) is located in another machine. You have to prefix that file with the name (or IP) of the machine, ended by a colon. You have to specify also the remote user if it is different from the local user.

To be more specific, the following command (issued in an xterm session in the tablet)
Code:

$ scp MyTabletFile foo@bar:folder
will stablish a ssh session with the machine bar, user foo, and copy the file MyTabletFile over this encrypted connection, leaving that file in the folder "folder" of the remote machine. This is a folder relative to the home of the user "foo" in that machine.

The command also works in the oppsite direction (but always issued from the tablet):

Code:

$ scp foo@bar:folder/file.ext .
This command will stablish a ssh session with machine bar, user foo, and copy the file ~/folder/file.ext (relative to the $HOME of the user foo in bar) to the local machine (the tablet), leaving it in the current directory (that is what means the final period).

Benson 2008-04-24 23:20

Re: ssh usage
 
You can use sftp or scp.

From wikipedia:

Copying file to host:
Code:

scp SourceFile.ext user@host:directory/TargetFile.ext
Copying file from host:
Code:

scp user@host:folder/SourceFile.ext TargetFile.ext
But I generally use sftp, which handles much like ftp.

Heh, beaten.

iliaden 2008-04-24 23:22

Re: ssh usage
 
thanks a lot!

desiv 2008-04-25 04:13

Re: ssh usage
 
Oh, that's just cold. ;(

Oh, the humanity!!!

;)

desiv

iliaden 2008-04-25 09:53

Re: ssh usage
 
???

explain yourself plz.

desiv 2008-04-25 14:36

Re: ssh usage
 
Quote:

Originally Posted by iliaden (Post 174499)
???
explain yourself plz.

Notice the smiley. I just thought it was funny.

I suggest you use scp and give you an example. And I suggest you use sftp as an alternative.

Next post suggests scp, and you clicked that it was helpful.
Next post suggests scp and sftp, and you clicked that it was helpful.

They were very descriptive and helpful posts.

I just thought it was funny. I have a weird sense of humor.

Take it easy.

desiv
:)

iliaden 2008-04-25 20:58

Re: ssh usage
 
there... happy now ;)

i needed the command along with the syntax.
btw, in scp (what I now use), the correct syntax for user@ip:/localpath :
the localpath is actually c:/* or D:/* or (in my case) R:/ (all the letters before r are already used except B - anyone has a 5-inch floppy reader? :D)
it's not /cygdrive/r/*


All times are GMT. The time now is 14:40.

vBulletin® Version 3.8.8