LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to connect 2 computers (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-connect-2-computers-900486/)

enero forte 08-31-2011 07:55 PM

how to connect 2 computers
 
hi
congratulates for the forum ! keep it up !

here is my call.
I have a computer (Linux) in the Bar-club which I and my friends are running as a Collective . I want to be able to connect the laptop at home with the computer at the Bar so I can play songs from its discs or do other home-works while Im working at the Bar-

so, Im begining this process of learning to create a wireless connection
join me and send me Ideas, Experiences and so on.


:-)
gnu antelope

ramkatral 08-31-2011 08:02 PM

Well my first question is... Does the laptop also run a variant of linux or is it a Windows machine? And you're wanting to play stuff ON the Linux machine at the bar FROM the laptop at home, correct? Obviously that's not gonna be able to be a wireless connection unless you live right next door. I'm assuming the machine at the bar has an internet connection as well as your laptop?

enero forte 09-01-2011 08:21 PM

sorry for the drop off
my friend has a son! At around 18:00 hrs MidEurpTime Today, Eduard came at this World in a Berlin fullest Hospital.

so.back to subject. My plan is read/download all around SSH from the page https://help.ubuntu.com/community/SSHHowto

and than hire share my experience and troubles.

thnx for your kindness of teaching newbees :-KKKK

ramkatral 09-02-2011 07:01 PM

Sorry if I sound redundant, I'm just having a hard time understanding your English. Not meaning that offensively, it's just a little difficult. I can help you much better if you could answer the questions I posted. Believe it or not, it does make a big difference in how you answer them. And don't worry, everyone starts as a newbie. No one is ever a guru. That's why this forum is so phenomenal.

P.S. Congrats to the new father! I have two of my own. They are the greatest gift a man can ever be given, and I thank the woman who blessed me with them every day.

P.P.S. I just had an amusing thought. Why is it that people like myself who natively speak English and, according to my college English grades, have a near masterful grasp of it, always have difficulty understanding people who don't speak it so well? Is it the same in other languages? Sorta like... If I were to come to Europe and speak some busted French, would native French people be able to understand me clearly or would it be a struggle for them, too?

frankbell 09-02-2011 07:32 PM

To make sure I understand, while at the Club, you want to be able to connect to the home computer.

The simplest way would be to ssh to the home ip address. For this to work properly, port forwarding must be set up in the home router to send calls to port 22 from the router to the laptop. If your home ip address is DHCP, which is what most ISPs use, a service such as no-ip.com or dyn.com could help. Both of them offer a no-charge option.

If you want to stream or ftp, you will need to implement a web or ftp server of some sort.

The help files at no-ip.com give very clear explanations of how to do this sort of stuff. I expect that the ones at Dyn (which used to be DynDNS) do also; I'm familiar with no-ip, because I quite happily used their services for over four years and had excellent service.

http://www.no-ip.com/support/

Edit: You would use ssh simply to connect and scp to transfer files. There are man pages for both.

Hevithan 09-02-2011 07:47 PM

Just as a suggestion, Couldn't a remote desktop viewer be setup on the bar system based on the IP of the laptop? I have that setup with my girlfriends computer so I can help her out from else where, no pass or acceptence needed. It's not exactly a 'networking' thing, But it would make it able to access the songs and stuff. Just tossing it out there.



And as a side note to ramkatral, I think English is hard even for those of us here. Different dialects and slang terms make it hard for someone from the northwest to understand someone from the east coast or the south. I assume it is hard for them (and us) because in English you are taught to describe then define (such as blue dog -descriptive- -definitive-) whereas most other languages it is reverse (baton rouge (stick red) -stick being definitive and red descriptive). It's hard to learn to speak backwards haha :)

ramkatral 09-02-2011 08:10 PM

Hey man, that makes sense. I've always wondered why English is considered one of the hardest languages in the world for non-native speakers to pick up. Especially when I look at something like Russian. Now that just looks difficult in every way. Of course, I'm sure a Russian doesn't view it as difficult at all. Anyway, I'll quit hijacking the thread.

frieza 09-02-2011 11:25 PM

this actually sounds like a job for hamachi, assuming the machine at the bar(club) has an internet connection, and at home you have an internet connection, then you install hamachi on both machines to create a 'tunnel' between the two, then either use samba (if the laptop is windows) or NFS (or fuse sshfs) over the hamachi tunnel to mount the disks on your laptop and play the contents, that is if the disks are mp3s or other file based music, if they are audio cds however, you would use vlc to stream over the hamachi tunnel
hamachi can be found here

enero forte 09-05-2011 05:09 PM

wow! you guys are great! so much options ! so much ideas!

Thank you Ramkatral! Yes both machines (machine is a BIG word for this junk but anyway...) are running Linux . The laptop at home has also windows- I can switch at the beginning between the two.
Hire we usually use rooters that comes with the telphn and so on. At home I have FRITZ.BOX and at the bar is 1&1 Different companies -same idea. Wireless WPA secured connection.

about the language. I will (try to) cut off the slang crap and I will try to express in the best engl I could.
by the way I speak also German,Spanish,Russian,Bulgarian ...and bad engl:-)
the thing is that in Grman we have COMPLETLY another structure of sentence.
so I may be sound unlogical to very often:-/

so.
what I did was trying the classic way.
first as I was in the pub I downloaded server AND client:

sudo apt-get install openssh-client openssh-server

than I did a few changes to the sshd_config file (yes I did a factory_default copy)

after this All ready at home I did the same thing. I also got the IP adreses from

ifconfig


as I was suspecting - it was not enough... All Im getting when I do

ssh usernameBARcomputer@192.168.x.xx

is:
ssh: connect to host xxx.xxx.xx.xx port 22: [B]Connection timed out[/B]

I need some answers about:

1.what IS forwarding of port? how we do it? (command line if possible!)
frankbell suggested this kindly but I dont know HOW TO


2. HOW TO check up if the SSH is working properly on the machine Im working with.

3. AN ESSENCIALL QUESTION!!! When i do operation in terminal, in root, HOW TO SAVE and FINISH THE OPERATION and come to a start position:

root@ubuntu:~#


I have tried to write END and push entr
to write EXIT and entr
to hit togather ctrl+D

does not work! And GENERALY : can you show me a good tutorial where I CAN EXERCISE ALSO my terminal command typeing ???

Are you all guys/girls from over the Ocean!?right now you probably get your first cofee...while Im hire take my last drops of beer and go dizzzzzzing

keep in touch

chrism01 09-05-2011 06:01 PM

Well, I'm on the opposite side of the world to you now (assume you are in Germany/Austria; you could add that to your profile), :) but I used to live in London and went to Germany to see the NFL (Düsseldorf, Frankfurt) several times.
Good party...


Anyway, here are some good cmd line tutorials
http://rute.2038bug.com/index.html.gz
http://tldp.org/LDP/Bash-Beginners-G...tml/index.html
http://www.tldp.org/LDP/abs/html/

It would help if we knew exactly which distro you have a both ends; post the results of these cmds
Code:

uname -a

cat /etc/*release*

for both systems.

As for qn 3; at the cmd line, the operation/cmd is done/complete when the prompt "root@ubuntu:~#" re-appears with nothing next to it.

There are lots of good guides here http://www.linuxtopia.org/online_boo...ion_index.html

HTH

Welcome to LQ; you'll enjoy it here :)

ramkatral 09-05-2011 07:18 PM

Well.... when you attempt to ssh to the IP address, you're actually trying to connect to the router. The router is what carries the IP from the provider. All the machines connected under the router use what's called NAT addresses (Locally assigned local network only addresses). Port forwarding is basically this: Let's say you wanna connect to a server that is under a router at port 80. When you input the IP address for that system on the remote computer it connects to the router on port 80. The router is set up to forward all incoming traffic on port 80 to the NAT of the server. So you need to set your router to forward the SSH request to the server. Otherwise it doesn't know what to do with the incoming connection. What router are you using? It should be easy to find a manual for it online.

Basically, without setting the router to forward that port, you are completely unable to reach any system on the local network under that router. With the proper forwarding set up... the router basically does what its name says... It routes inbound/outbound traffic on the network to where it's needed.

And BTW, the foreign language I've taken in college is German, so... Ich spreche Deutsch. :)

And about the DHCP frankbell is talking about... Generally most ISPs use dynamic IP assignment, which means everytime you connect to the provider you receive a new IP from a pool of available addresses. The sites he listed use what's called DNS name servers that give you a static hostname (IE: Mybutt.dyndns.com) and allow you to update the nameserver with your new IP address. So basically when you wanna connect to your server you just connect to mybutt.dyndns.com and the nameserver forwards the request to your actual IP address.

enero forte 09-06-2011 10:29 AM

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=10.04
DISTRIB_CODENAME=lucid
DISTRIB_DESCRIPTION="Ubuntu 10.04.3 LTS"


this is the PC at the bar

i guess the one I have at home is with the same construction. I will post it later.

chrism01: As for qn 3; at the cmd line, the operation/cmd is done/complete when the prompt "root@ubuntu:~#" re-appears with nothing next to it.
this I know . but I dont know how to End (and shure it is saved!)


ramkatral, I think you got exactly where the problem is.
first i have to work
than i have time to read... I hope!
thanks all of you for teaching me!!!!!!

ramkatral 09-06-2011 02:41 PM

Quote:

Originally Posted by enero forte (Post 4462977)
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=10.04
DISTRIB_CODENAME=lucid
DISTRIB_DESCRIPTION="Ubuntu 10.04.3 LTS"


this is the PC at the bar

i guess the one I have at home is with the same construction. I will post it later.

chrism01: As for qn 3; at the cmd line, the operation/cmd is done/complete when the prompt "root@ubuntu:~#" re-appears with nothing next to it.
this I know . but I dont know how to End (and shure it is saved!)


ramkatral, I think you got exactly where the problem is.
first i have to work
than i have time to read... I hope!
thanks all of you for teaching me!!!!!!

If you can tell me the brand and model of your router I can probably help you with exactly how to configure it to forwards the correct ports to the proper machine. Once that's done, it's a very simple matter to make the connection between two linux systems.

schneidz 09-06-2011 03:17 PM

my suggestion would be to use sshfs to connect to your home laptop (which communicates over ssh). then use xbmc-live on the bar-pc.


also, not really sure what fritz-box is:
http://www.google.com/search?q=FRITZ...ient=firefox-a

is there a way to log into it. maybe from your home laptop you can type in this address in firefox: 192.168.1.1 (or 192.168.0.1) and set it up.
else you can try calling your isp and asking how to do it but maybe they make it impossible so you would have to pay more for their hosting (if thats the case you would be better off buying an actual router like netgear, linksys...)?

chrism01 09-06-2011 05:58 PM

When the prompt re-appears it IS done, There is no more to be done. No 'END' to do, no 'SAVE' to be done.
If no error occurred its fine.
If you want, you can check the '$?' aka exit status value immediately after the cmd; should be zero for ok cmd eg
Code:

prompt: some-cmd
prompt: echo $?
prompt: 0

all good :)

enero forte 09-06-2011 09:22 PM

chrism01,
the problem is when it DOES NOT appear...
when I see the prompt

root@ubuntu:~#

its clear to me we are at the beginning.

but as I was doing ssh , dont remember what exactly, i couldn't come to prompt!

once the cursor was blinking at the beginning of empty row

other time it was showing at which page in man. Im but i couldn't get out.
so i had to terminate the window...and it asked me
"are u sure?there is process going on"

but, don't bother! I will find it once I get more experience with the terminal

enero forte 09-06-2011 09:32 PM

ramkatral, im right now doing the steps shown hire:

https://help.ubuntu.com/community/ServersBehindNAT

because you pointed to NAT, the whole thing (pc-rooter-net-rooter-pc) was not clear to me. I was thinking more like this: rooter-rooter


schneidz, i can reach the fritz.box without problem. its at home so I did the connection and know the interface.
but the other rooter gives me trouble....there are too much people messing around it. since it is in a bar...

enero forte 09-07-2011 04:41 AM

chrism01, when the prompt with my user-name is there i know we are OK
the problem was taht there was no prompt at beginning!
anyhow. when I can put my question clearly (explain WHAT operation I was doing) than we come back to subject.

ramkatral, my rooter is

FRITZ!Box Fon WLAN 7113 (UI)

i go in and out whenever i write the name of it in my browser and than identify myself with password.

DSL -ready
WLAN - on, secured
LAN -not connected

right now Im doing the steps from this manual:

https://help.ubuntu.com/community/ServersBehindNAT

since you show me the crucial mistake in my logic Im on a better way.
I was seing more the things like this
computer-computer
and the routers between as a part of the whole connection
now I see that the things are more

computer -router -net -router -computer
et essential is the connectin between ma computer and my rooter and the same is in the bar.

enero forte 09-07-2011 05:16 AM

first problem on Horizont!

when I try to find to which PORT listens my SERVER
(I go to NETWORKTOOLS, than PORTSCAN and I put the address that DEVICE say is my computer uses to talk with the router)

Hire I have to see on right somewhere SERVER and on left the NUMBER of the Port. BUT all I see is this (the numbers of ports are changed):
port state service
5700 open unknown
38573 open unknown
57862 open unknown

I DONT KNOW WHICH OF THOSE PORTS IS THE ONE I NEED!!!

enero forte 09-07-2011 05:22 AM

Local Peer
12x.0.0.x:xxx
::1:6xx
*:5xxx users:(("vino-server",1515,19))
:::5xxx users:(("vino-server",1515,18))


this is what I get when I do

ss -altnp | perl -ne '@_=split;printf"%-20s %s\n",@_[2,4]'


again it does not say anything about SSHd


do I have to Install SSH again?

schneidz 09-07-2011 11:10 AM

not able to figure out what the previous posts are trying to tell us.

from your home-pc type in ssh localhost and see if you can login. then see if you can login from another pc connected to the same wifi router.

Quote:

Originally Posted by enero forte (Post 4463446)
chrism01,
the problem is when it DOES NOT appear...
when I see the prompt

root@ubuntu:~#

its clear to me we are at the beginning.

but as I was doing ssh , dont remember what exactly, i couldn't come to prompt!

once the cursor was blinking at the beginning of empty row

ctrl-c to cancel... ssh is probably stuck trying to connect to your frizzy box (whatever that is).

enero forte 09-07-2011 03:07 PM

ubuntu plague!
 
Quote:

Originally Posted by schneidz (Post 4463994)
not able to figure out what the previous posts are trying to tell us.

from your home-pc type in ssh localhost and see if you can login. then see if you can login from another pc connected to the same wifi router.

ctrl-c to cancel... ssh is probably stuck trying to connect to your frizzy box (whatever that is).

ok. than slowly.


I try to find the TCP or UDP port my server listens on. when i know it i can write same number in my router and -did it!to check this i used this command:

ss -altnp | perl -ne '@_=split;printf"%-20s %s\n",@_[2,4]'

and I guess, I was expecting to see a port already with sshd server beside it.now i think I had to choose one of the open numbers and just put it in the router

now i will try to connect as you say. to do this Im installing on another laptop also ubuntu...
The Jinn is out of the bottle ! now, in this house, the time we spent benind the blue screen gets less and less....Ubuntu eats all machines around!
-------
fritzbox is just a name of a product line of routers. I assumed ppl will understand I mean a classic home router -those the phone companies give you with one or two telphn numbers and internet.
yes, there are things that you have not heard of .its totaly ok :)

enero forte 09-07-2011 03:12 PM

result
 
Quote:

Originally Posted by schneidz (Post 4463994)

from your home-pc type in ssh localhost and see if you can login.


ssh: connect to host localhost port 22: Connection refused

enero forte 09-07-2011 03:47 PM

Itry to check if ssh is up at 22 port by command:
netstat -ln | grep 22

and the result was:

unix 2 [ ACC ] STREAM LISTENING 14974 /tmp/orbit-bitch/linc-660-0-472817f272259
unix 2 [ ACC ] STREAM LISTENING 15524 /tmp/orbit-bitch/linc-6e3-0-6b224a7d77a47
unix 2 [ ACC ] STREAM LISTENING 11223 /tmp/keyring-UoESQJ/pkcs11
unix 2 [ ACC ] STREAM LISTENING 12282 /tmp/orbit-bitch/linc-626-0-7677a80be853e
root@ubuntu:~#

so than I try to start sshd with command :


root@ubuntu:~# /usr/sbin/sshd -d
result is:
/etc/ssh/sshd_config: line 89: Bad configuration option: ps
/etc/ssh/sshd_config: line 90: Bad configuration option: exit
/etc/ssh/sshd_config: terminating, 2 bad configuration options


ANY IDEAS FROM HIRE ON ?

chrism01 09-07-2011 07:54 PM

Ok; lets do one problem at a time, otherwise it'll ge tmessy.
First, assuming you want to use ssh, let's establish which box is the 'client' and which the 'server' eg

client(ssh) --> server (sshd)

ie client issue the ssh cmd (not sshd) to connect to server, which should be running sshd (d = daemon; server only)

Typically
Code:

client> ssh user@server_fully-qualified_domain-name

# OR
client> ssh user@ip.of.server.here

Note that the server needs to have port 22 open on the firewall as sshd normally listens on port 22.
The client chooses a random outgoing port (>1023), so you can usually ignore firewall settings on client, as these are normally allowed.
To check firewall
Code:

iptables -nvL
on both systems.
Note also that if your server is not directly on the internet, but going through a router/modem, then you'll need to enable port forwarding on the router to fwd port 22 to the server for incoming cxns.

HTH

Re your sshd -d test; its telling you you have bad syntax in the cfg file /etc/ssh/sshd_config: post this also.
http://www.openbsd.org/cgi-bin/man.c...penBSD+Current

schneidz 09-07-2011 08:04 PM

^ your sshd_config file probably got messed up... try commenting out those lines.

chris makes some great points.
lets start from the inside out.
in the first terminal run this:
sudo /etc/init.d/ssh stop
sudo sshd -d -d -d
# open another terminal window and type:
ssh -v -v -v localhost

copy and paste the output into your next post.


once that is working the next step would be to run:
ssh -v -v -v <internal-ip-address-of-server>
on another machine in your house.

the step after that would be to run:
ssh -v -v -v <ip-address-of-router>
from the bar.

ramkatral 09-07-2011 08:47 PM

That's what I keep trying to tell you. You are getting connection refused because your router is not forwarding the ssh request to the server. Nothing anyone here tells you will work until you tell your router to forward connections on port 22 to the server. That must be done first and formost. Once you do that you can ssh to the server to your heart's desire.

Edit: I just saw the part about the bad configuration file. I'm a hardware and networking kinda guy. I'll let these guys more knowledgeable with that part help.


All times are GMT -5. The time now is 01:06 PM.