LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   set firewall and allow access for ssh, rsync to copy files to another laptop (https://www.linuxquestions.org/questions/linux-software-2/set-firewall-and-allow-access-for-ssh-rsync-to-copy-files-to-another-laptop-4175664002/)

Pedroski 11-10-2019 04:19 AM

set firewall and allow access for ssh, rsync to copy files to another laptop
 
I am trying to copy files from this laptop to another laptop on my local network. I am using my wireless connection.

On the receiving end, I installed ufw, ran this:



Quote:

sudo ufw allow 22/tcp

sudo ufw enable
Quote:

sudo ufw status shows

22/tcp ALLOW IN Anywhere
22/tcp (v6) ALLOW IN Anywhere
But I am getting this:

Quote:

pedro@pedro-newssd:~$ rsync -av -e "ssh" --progress /home/pedro/backgrounds/ pedro@192.168.1.4:/home/pedro/
ssh: connect to host 192.168.1.4 port 22: Connection refused
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(235) [sender=3.1.2]
pedro@pedro-newssd:~$
I also tried, without success:
Quote:

sudo ufw allow from 192.168.0.0/16
Any tips please?

This laptop, at the moment, has the local ip 192.168.1.3
I am trying to copy files to 192.168.1.4

I can ping the other laptop:

Quote:

pedro@pedro-newssd:~$ ping -c 5 192.168.1.4
PING 192.168.1.4 (192.168.1.4) 56(84) bytes of data.
64 bytes from 192.168.1.4: icmp_seq=1 ttl=64 time=14.9 ms
64 bytes from 192.168.1.4: icmp_seq=2 ttl=64 time=8.72 ms
64 bytes from 192.168.1.4: icmp_seq=3 ttl=64 time=6.55 ms
64 bytes from 192.168.1.4: icmp_seq=4 ttl=64 time=7.15 ms
64 bytes from 192.168.1.4: icmp_seq=5 ttl=64 time=10.2 ms

--- 192.168.1.4 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4007ms
rtt min/avg/max/mdev = 6.552/9.528/14.996/3.018 ms
pedro@pedro-newssd:~$

allend 11-10-2019 05:55 AM

Quote:

ssh: connect to host 192.168.1.4 port 22: Connection refused
Your ssh connection is failing. Is the sshd service running on 192.168.1.4?
The output of 'ssh -v pedro@192.168.1.4' may be informative. (You can use -vvv for further output).

Also, why bother with SSH in a local LAN? Do you not trust yourself?

berndbausch 11-10-2019 06:10 AM

Quote:

Originally Posted by allend (Post 6056112)
Also, why bother with SSH in a local LAN? Do you not trust yourself?

Reasons for using SSH:
  • Curiosity: To explore this technology
  • Convenience: Secure access without password, using keys or certificates
  • Paranoia: What if somebody breaks into my network
  • Convenience: It's ubiquitous and just works
  • Laziness: I don't want to configure an rsync daemon (yes, it's probably done automatically when installing the OS, but it's yet another config that can break)
  • Why not?

The error message indicates that the firewall lets the connection request come in, but there is nothing to connect to. I.e. as allend says, sshd is probably not running.

Pedroski 11-10-2019 07:14 AM

Well, I don't know what I'm doing really, not a computer man. I can use rsync and ssh to connect to my webpage and collect students' homework, so I thought I needed ssh.

Can I just use rsync? I believe, rsync will, by default, call ssh.

Are you saying, I need to have ssh running on the receiving laptop?

Pedroski 11-10-2019 07:27 AM

Got it!

I did not have ssh server installed on the receiving computer.

Quote:

sudo apt install --assume-yes openssh-server


All times are GMT -5. The time now is 03:58 PM.