LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-31-2016, 07:50 PM   #1
Pedroski
Senior Member
 
Registered: Jan 2002
Location: Nanjing, China
Distribution: Ubuntu 20.04
Posts: 2,116

Rep: Reputation: 73
sharing computers on a home network


Hi,
I just want to connect my old laptop and the newer one. I plugged them together with an ethernet cable

I have followed the instructions here:

http://askubuntu.com/questions/22835...thout-a-router

and I can ping one computer from the other. 10.42.0.96 is the inet addr of the old laptop, as shown by ifconfig

pedro@pedro-schule:~$ ping -c 5 10.42.0.96
PING 10.42.0.96 (10.42.0.96) 56(84) bytes of data.
64 bytes from 10.42.0.96: icmp_seq=1 ttl=64 time=0.360 ms
64 bytes from 10.42.0.96: icmp_seq=2 ttl=64 time=0.378 ms
64 bytes from 10.42.0.96: icmp_seq=3 ttl=64 time=0.360 ms
64 bytes from 10.42.0.96: icmp_seq=4 ttl=64 time=0.339 ms
64 bytes from 10.42.0.96: icmp_seq=5 ttl=64 time=0.366 ms

--- 10.42.0.96 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4003ms
rtt min/avg/max/mdev = 0.339/0.360/0.378/0.024 ms
pedro@pedro-schule:~$

Excuse my ignorance, but how do I actually browse from one computer to the other?

When I right click say the pictures folder, and then click the box to share, I get "You need to install the Windows networks sharing service in order to share your folders."
Why do I need Windows networks for 2 Ubuntu computers??? I did not do that.

Last edited by Pedroski; 05-31-2016 at 08:12 PM.
 
Old 05-31-2016, 07:56 PM   #2
notKlaatu
Senior Member
 
Registered: Sep 2010
Location: Lawrence, New Zealand
Distribution: Slackware
Posts: 1,077

Rep: Reputation: 732Reputation: 732Reputation: 732Reputation: 732Reputation: 732Reputation: 732Reputation: 732
It's telling you that you need Windows Sharing (SAMBA) to browse folders the way you are trying to browse them.

Alternate methods of browsing include NFS and SSH(FS). Both are actually pretty easy to setup, but SSH FS is pretty much already there, so maybe use it.

I don't know to invoke it with Ubuntu's file manager; I think it's in a menu called 'Go' > Locations > (enter IP address of other computer)

but in Dolphin (from KDE), you can just type in 'pedro@10.42.0.96' and you'll be in (after authentication).

I wrote up some notes about it, if it helps:

http://straightedgelinux.tk/unix/fish/?dir=unix
 
Old 05-31-2016, 09:10 PM   #3
Pedroski
Senior Member
 
Registered: Jan 2002
Location: Nanjing, China
Distribution: Ubuntu 20.04
Posts: 2,116

Original Poster
Rep: Reputation: 73
Thanks, but I'm still struggling!

1 laptop is pedro-bedro2 the newer one is pedro-schule If I try ssh from pedro-schule, I get:

pedro@pedro-schule:~$ ssh://pedro@pedro-bedro2
bash: ssh://pedro@pedro-bedro2: No such file or directory
pedro@pedro-schule:~$

The same the other way round. What am I doing wrong??
 
Old 05-31-2016, 09:19 PM   #4
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,579

Rep: Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685
Keep it simple

You must either enter them into your local DNS (and if you had one you would know that and know how, or add them to each others /etc/hosts file to address them by name. The alternative is to address them by the IP address of the interface you can reach from the other.

Names do not resolve by magic, and network works by address not name.
DNS and network resolution is an interesting subject, but just adding a name and ip pair to the hosts file is easy.

I hope that helps.
 
1 members found this post helpful.
Old 05-31-2016, 09:35 PM   #5
notKlaatu
Senior Member
 
Registered: Sep 2010
Location: Lawrence, New Zealand
Distribution: Slackware
Posts: 1,077

Rep: Reputation: 732Reputation: 732Reputation: 732Reputation: 732Reputation: 732Reputation: 732Reputation: 732
From your earlier example, it appears that 10.42.0.96 is pedro-bedro2

I don't know the address of the other one. Let's pretend like it's 10.42.0.97 to keep things simple.

As wpeckham said, you can either address them by their IP (the numbers) or you can associate those numbers with names.

The problem with using the numbers is that it is inconvenient (you have to remember numbers).

The problem with using the names is that the numbers could change tomorrow..or next week (it depends on your router settings, and how much traffic you get on your home router).

One way to make it all happy is to:

1. log in to your home router and lock in the IP addresses according to each computer. This is usually done in a section called 'Static Addresses' or 'DHCP List' or something like that: it's the area in the router that sees what devices are currently connected to it, what IP address they got assigned, and it usually lets you make that address assignment permanent (a kind of "if you see this device ask for an address, ALWAYS give it address x.x.x.x" statement).

Since all routers are different, I can't tell you exactly how to do this. You'll have to poke around.

2. Add host entries into your /etc/hosts file of each computer.

So on pedro-schule:

Code:
$ sudo echo "10.42.0.96 pedro-bedro2" >> /etc/hosts
And on pedro-bedro2:

Code:
$ sudo echo "10.42.0.97 pedro-schule" >> /etc/hosts
See how you are telling each one where to find the other?

3. test it!

From pedro-bedro2:

Code:
$ ping pedro-schule
And from pedro-schule:

Code:
$ ping pedro-bedro2
Assuming that works, you should now be able to ssh from one to the other.

Last edited by notKlaatu; 05-31-2016 at 09:37 PM.
 
Old 05-31-2016, 10:33 PM   #6
Pedroski
Senior Member
 
Registered: Jan 2002
Location: Nanjing, China
Distribution: Ubuntu 20.04
Posts: 2,116

Original Poster
Rep: Reputation: 73
Thanks for that.

I do add a lot of things to hosts. That was a tip from Frank Bell here: I am in China, anything connecting to google ads and things google slows down the load time almost to a stop. I just put: 127.0.0.1 google.com

I presume this tells the browser to look in 127.0.0.1 for the link, it finds nothing and moves on. Definitely speeds up my web experience!

I'd like to leave out the router first, just connect directly, mainly because I am useless at this and I will not get it working! Then I'll buy an ethernet hub, try all 4 computers. Then try the router.

I'm trying to keep it simple, because I am no good at this at all. It's a book with 7 seals!

I am actually, at the moment just connecting the 2 laptops with an ethernet cable. I created a ethernet connection homenet on both laptops.

Before I start homenet, with the cable plugged in, I am on Wired connection 1 and I had the inet address: 10.42.0.96 on pedro-bedro2 I can ping that with the cable plugged in the new laptop, pedro-schule.

Start homenet with the cable plugged in to both computers, I can ping.

Trouble is, as I see it, when I start homenet on the old laptop, pedro-bedro2 on eth2, it gets the same inet address as the new laptop pedro-schule namely 10.42.0.1

I could imagine that might lead to problems.
 
Old 05-31-2016, 11:07 PM   #7
Pedroski
Senior Member
 
Registered: Jan 2002
Location: Nanjing, China
Distribution: Ubuntu 20.04
Posts: 2,116

Original Poster
Rep: Reputation: 73
Ok, I can ping pedro-bedro2 from here, pedro-schule and ping pedro-schule from pedro-bedro2

I entered ssh pedro-bedro2 and got this:

Quote:
pedro@pedro-schule:~$ ssh pedro-bedro2
The authenticity of host 'pedro-bedro2 (127.0.1.1)' can't be established.
ECDSA key fingerprint is db:b6:68:29:04:02:27:dc:fe:0d:02:54:24:92:74:36.
Are you sure you want to continue connecting (yes/no)? y
Please type 'yes' or 'no': yes
Warning: Permanently added 'pedro-bedro2' (ECDSA) to the list of known hosts.
pedro@pedro-bedro2's password:
Welcome to Ubuntu 14.04.4 LTS (GNU/Linux 3.16.0-71-generic x86_64)

* Documentation: https://help.ubuntu.com/


The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.
I thought I might get nautilus or something and be able to browse pedro-bedro2 from here, pedro-schule. How do I do that please??

I think I got it, at least from the old computer, pedro-bedro2, I can see pedro-schule

I did that in the nautilus window, clicked connect to server, entered: ssh://pedro-schule It asked me for my password and it worked!! Yeah, amazing for me!

Doesn't work from pedro-schule to pedro-bedro2 though. Have to set the server on that one too I suppose.

Thanks for your tips!

Last edited by Pedroski; 05-31-2016 at 11:17 PM.
 
Old 06-01-2016, 06:32 AM   #8
Pedroski
Senior Member
 
Registered: Jan 2002
Location: Nanjing, China
Distribution: Ubuntu 20.04
Posts: 2,116

Original Poster
Rep: Reputation: 73
Works now, but still got a problem:

I can now successfully browse my new laptop from my old laptop, which is great progress for me!

The other way around does not work.

Do I have to set the old laptop to be a server too? The address of the old laptop is 10.42.0.96 and the new one is 10.42.0.1

I can ping both ways, but I can't browse the old laptop from the new laptop.

pedro@pedro-schule:~$ ping -c 5 10.42.0.96
PING 10.42.0.96 (10.42.0.96) 56(84) bytes of data.
64 bytes from 10.42.0.96: icmp_seq=1 ttl=64 time=0.408 ms
64 bytes from 10.42.0.96: icmp_seq=2 ttl=64 time=0.294 ms
64 bytes from 10.42.0.96: icmp_seq=3 ttl=64 time=0.589 ms
64 bytes from 10.42.0.96: icmp_seq=4 ttl=64 time=0.323 ms
64 bytes from 10.42.0.96: icmp_seq=5 ttl=64 time=0.386 ms

--- 10.42.0.96 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 3997ms
rtt min/avg/max/mdev = 0.294/0.400/0.589/0.103 ms
pedro@pedro-schule:~$
 
Old 06-01-2016, 07:08 AM   #9
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,289
Blog Entries: 3

Rep: Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718
Quote:
Originally Posted by Pedroski View Post
Do I have to set the old laptop to be a server too?
When you connect from any of the machines, you can use the tools that are built-in by default. There are various ssh and sftp clients, as you've found. So nothing needs to be added.

When you connect to any of the machines, the target machine does have to be running sshd, which is provided by the package openssh-server. You have it set up already for one machine, it just needs to be added to the other(s).

Make sure the accounts have very good passwords, especially if they are going to be connected to the open Internet at some point and not just the LAN. But even on the LAN it is a good idea to follow best practices. And speaking of best practices, if you keep the SSH server running all the time, then you might want to set up authentication with keys and disable passwords for SSH.
 
1 members found this post helpful.
Old 06-01-2016, 09:42 PM   #10
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,579

Rep: Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685
Quote:
Originally Posted by Turbocapitalist View Post
When you connect from any of the machines, you can use the tools that are built-in by default. There are various ssh and sftp clients, as you've found. So nothing needs to be added.

When you connect to any of the machines, the target machine does have to be running sshd, which is provided by the package openssh-server. You have it set up already for one machine, it just needs to be added to the other(s).

Make sure the accounts have very good passwords, especially if they are going to be connected to the open Internet at some point and not just the LAN. But even on the LAN it is a good idea to follow best practices. And speaking of best practices, if you keep the SSH server running all the time, then you might want to set up authentication with keys and disable passwords for SSH.
Good advice. I want to also add: if you allow access to them from the internet with standard services like sshd on standard ports (22), add something like fail2ban to prevent simple dictionary attacks. I have an sftp server that has banned half of China, most of the Pacific rim, portions of South America, and a good chunk or Europe due to brute force attacks I have intercepted. Even a rather large portion of the Microsoft corporation address space, and I have NO idea why they would be probing my address space!!!

It can be a Jungle out there!

Always remember the first law of the jungle is: "Don't tease the animals!".

Last edited by wpeckham; 06-01-2016 at 09:43 PM.
 
Old 06-02-2016, 12:05 AM   #11
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,289
Blog Entries: 3

Rep: Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718
Quote:
Originally Posted by wpeckham View Post
Even a rather large portion of the Microsoft corporation address space, and I have NO idea why they would be probing my address space!!!
Interesting to know. I know of others that have been on the receiving end of DDoS attacks which included some machines from them. As to why? They have a lot of machines running an unsafe brand of OS and from here it looks like quite a few end up in bot nets.

So fail2ban, sshguard, or even plain rate limiting in iptables all help as part of layered security.
 
Old 06-02-2016, 05:10 AM   #12
Pedroski
Senior Member
 
Registered: Jan 2002
Location: Nanjing, China
Distribution: Ubuntu 20.04
Posts: 2,116

Original Poster
Rep: Reputation: 73
Thanks you guys.

I really don't know anything about this. I am just experimenting. I always wanted to know how to do this!

So: install fail2ban and sshguard? Or either will do?

I probably won't use this LAN thing much, but sometimes it is handy I suppose, if I can just get a file off of another computer without going via a usb-stick!
 
Old 06-02-2016, 05:28 AM   #13
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,289
Blog Entries: 3

Rep: Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718
Quote:
Originally Posted by Pedroski View Post
So: install fail2ban and sshguard? Or either will do?
They do approximately the same thing, but it would be best for you to read over the project web pages and decide which looks interesting, or if neither are interesting. iptables itself can do rate limiting, but the automated probes tend to be distributed nowadays as well as coming in slowly, so most mitigation tactics don't really work except for using keys and turning off passwords for remote login. Though OpenSSH could be configured to allow passwords via the LAN but require keys and only keys on any other network.

Have fun experimenting.
 
1 members found this post helpful.
Old 06-02-2016, 07:48 AM   #14
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,579

Rep: Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685
Quote:
Originally Posted by Pedroski View Post
Thanks you guys.

I really don't know anything about this. I am just experimenting. I always wanted to know how to do this!

So: install fail2ban and sshguard? Or either will do?

I probably won't use this LAN thing much, but sometimes it is handy I suppose, if I can just get a file off of another computer without going via a usb-stick!
One or more of those options (and some hardening) are appropriate IF you put them on the internet.
As long as you are on a private and protected LAN only, such precautions are overkill. Just take time to think before you open things up.
As Turbocapitalist pointed out, you only need ONE blocking solution at most. Read the notes, description, FAQ, and documents (perhaps WIKI) related to the projects to figure out which will fit and server you better.

Let us know if you need links. I have never dealt with issues where Google was not an option, but one of us can always Google for the links and present them for you (and others in the same boat) to access.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sharing a folder between two network computers reverse Debian 2 08-14-2007 11:05 AM
How do you view Linux computers on a home network? dlackovic Linux - Newbie 8 01-10-2006 11:41 AM
see other computers on home network daedalusonlinux Linux - Networking 4 11-19-2005 05:40 PM
discovering computers on home network? mma8x Linux - Networking 7 11-07-2005 09:23 PM
File Sharing Windoze Network Computers deepgrewal SUSE / openSUSE 11 10-12-2005 10:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration