Why use ssh with local connections?

Chat about Linux in general
Post Reply
User avatar
catweazel
Level 16
Level 16
Posts: 6983
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Why use ssh with local connections?

Post by catweazel » Sat Aug 04, 2018 4:05 am

viewtopic.php?f=47&t=274914

In the thread above, the OP appears to be using rsync with ssh to sync two locally attached drives, though I concede that isn't necessarily true. A little later in the thread, another poster uses ssh to sync between two machines on the same LAN.

In the first case, I rather think that using ssh is completely pointless. In the second case, it would also seem to be completely pointless if the destination machine on the local network also serves files and the LAN is sitting behind a NAT. I would have thought that using ssh would only be of benefit when communicating with remote machines.

Is there a method to this madness that I'm not seeing?
Caution: Dancing Wu Li Master and Official curmudgeon-in-chief

HaveaMint
Level 4
Level 4
Posts: 304
Joined: Fri Feb 02, 2018 9:56 pm
Location: Somewhere in th USA
Contact:

Re: Why use ssh with local connections?

Post by HaveaMint » Sat Aug 04, 2018 5:12 am

catweazel wrote:
Sat Aug 04, 2018 4:05 am
viewtopic.php?f=47&t=274914

using rsync with ssh to sync two locally attached drives
I had to read this a few times before I finally wrapped my head around it (it's late) I haven't a clue why ssh is used for two drives on the same machine. I think that's how I'm reading it. I use ssh on two PC's but not on the same PC. Plus I'm lazy and use grsync.
"Tune for maximum Smoke and then read the Instructions".

User avatar
catweazel
Level 16
Level 16
Posts: 6983
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Why use ssh with local connections?

Post by catweazel » Sat Aug 04, 2018 5:16 am

HaveaMint wrote:
Sat Aug 04, 2018 5:12 am
catweazel wrote:
Sat Aug 04, 2018 4:05 am
viewtopic.php?f=47&t=274914

using rsync with ssh to sync two locally attached drives
I had to read this a few times before I finally wrapped my head around it (it's late) I haven't a clue why ssh is used for two drives on the same machine. I think that's how I'm reading it. I use ssh on two PC's but not on the same PC. Plus I'm lazy and use grsync.
You read it the same as I did but, without asking and disrupting the thread, there's no way to know if the OP, for example, has set up an NFS connection on one of those mount points.
Caution: Dancing Wu Li Master and Official curmudgeon-in-chief

HaveaMint
Level 4
Level 4
Posts: 304
Joined: Fri Feb 02, 2018 9:56 pm
Location: Somewhere in th USA
Contact:

Re: Why use ssh with local connections?

Post by HaveaMint » Sat Aug 04, 2018 5:17 am

Plus when you said "in the thread above " I went back to here and looked above viewforum.php?f=61&sid=7ca0011fc334c78d2d743894f3d4ac2b like I said it's late. :oops:
"Tune for maximum Smoke and then read the Instructions".

User avatar
catweazel
Level 16
Level 16
Posts: 6983
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Why use ssh with local connections?

Post by catweazel » Sat Aug 04, 2018 5:21 am

HaveaMint wrote:
Sat Aug 04, 2018 5:17 am
Plus when you said "in the thread above " I went back to here and looked above viewforum.php?f=61&sid=7ca0011fc334c78d2d743894f3d4ac2b like I said it's late. :oops:
lol
Caution: Dancing Wu Li Master and Official curmudgeon-in-chief

User avatar
smurphos
Level 6
Level 6
Posts: 1401
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher...

Re: Why use ssh with local connections?

Post by smurphos » Sat Aug 04, 2018 5:46 am

catweazel wrote:
Sat Aug 04, 2018 4:05 am
another poster uses ssh to sync between two machines on the same LAN.
i use rsync via ssh and sftp to mount shared drives on my LAN. Reason being is I find it way more simple to set up and maintain that p**sing around with that sorry mess called samba.

User avatar
catweazel
Level 16
Level 16
Posts: 6983
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Why use ssh with local connections?

Post by catweazel » Sat Aug 04, 2018 5:52 am

smurphos wrote:
Sat Aug 04, 2018 5:46 am
catweazel wrote:
Sat Aug 04, 2018 4:05 am
another poster uses ssh to sync between two machines on the same LAN.
i use rsync via ssh and sftp to mount shared drives on my LAN. Reason being is I find it way more simple to set up and maintain that p**sing around with that sorry mess called samba.
I use NFS, it's much simpler to install and get running.
Caution: Dancing Wu Li Master and Official curmudgeon-in-chief

User avatar
smurphos
Level 6
Level 6
Posts: 1401
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher...

Re: Why use ssh with local connections?

Post by smurphos » Sat Aug 04, 2018 6:03 am

catweazel wrote:
Sat Aug 04, 2018 5:52 am
I use NFS, it's much simpler to install and get running.
Another perfectly good option.

I went with SFTP to make it easier for Android and ChromeOS devices to access the shared drive as-well. Last time I checked there wasn't a good NFS client for Android, but my favoured Android File Manager and Sync client both support SFTP.

User avatar
catweazel
Level 16
Level 16
Posts: 6983
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Why use ssh with local connections?

Post by catweazel » Sat Aug 04, 2018 6:15 am

smurphos wrote:
Sat Aug 04, 2018 6:03 am
catweazel wrote:
Sat Aug 04, 2018 5:52 am
I use NFS, it's much simpler to install and get running.
Another perfectly good option.

I went with SFTP to make it easier for Android and ChromeOS devices to access the shared drive as-well. Last time I checked there wasn't a good NFS client for Android, but my favoured Android File Manager and Sync client both support SFTP.
Ah. I just use KDE Connect.
Caution: Dancing Wu Li Master and Official curmudgeon-in-chief

User avatar
smurphos
Level 6
Level 6
Posts: 1401
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher...

Re: Why use ssh with local connections?

Post by smurphos » Sat Aug 04, 2018 6:17 am

catweazel wrote:
Sat Aug 04, 2018 6:15 am
Ah. I just use KDE Connect.
Horses for Courses eh... :wink:

User avatar
catweazel
Level 16
Level 16
Posts: 6983
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Why use ssh with local connections?

Post by catweazel » Sat Aug 04, 2018 6:18 am

smurphos wrote:
Sat Aug 04, 2018 6:17 am
catweazel wrote:
Sat Aug 04, 2018 6:15 am
Ah. I just use KDE Connect.
Horses for Courses eh... :wink:
lol - indeed.
Caution: Dancing Wu Li Master and Official curmudgeon-in-chief

rene
Level 8
Level 8
Posts: 2075
Joined: Sun Mar 27, 2016 6:58 pm

Re: Why use ssh with local connections?

Post by rene » Sat Aug 04, 2018 7:22 am

catweazel wrote:
Sat Aug 04, 2018 4:05 am
In the thread above, the OP appears to be using rsync with ssh to sync two locally attached drives, though I concede that isn't necessarily true.
Indeed it is not; he specifies --rsh=ssh but only when either source or destination is remote does rsync in fact use the configured remote-shell transport. With local sources and destinations -- and that is very much including on network-mounted drives such as NFS-mounted ones: once mounted they're to rsync simply local -- no remote-shell transport is involved; as far as it itself is concerned, rsync uses simple copies.

Once one or both of source or destination is legitimately non-local, using ssh does make some sense even on a private LAN. Foregoing its daemon mode, rsync needs a remote-shell and while that could for example be plain rsh instead of ssh, any remote-shell implementation other than ssh has by now fallen from grace. That is, although the s(ecure) part of ssh may be pointless on a private LAN, the sh(ell) part is not.

Given a personal disdain for "secuwity" as a substitute for having a clue, I stuck with rsh/rlogin for the longest time on my local LAN but stopped doing so one or two distributions ago when I needed ssh anyway for actual remote remote-shell, and installing rsh needed specific scrounging around to find out which BSD-like package the distribution-of-the-day had relegated it to -- or IIRC in fact since on one of the used distributions that seldomly used package started bombing out

I see that on a standard Mint install rsh in fact is ssh unless you install e.g. rsh-client which confuses things a bit, but also note you do not in fact need the "--rsh=ssh" parameter anyway since ssh is the default remote-shell transport on Debian/Ubuntu/Mint. Specifying that option does nothing magical; not even anything "secuwe".

[EDIT] Cleaned up some grammar only.
Last edited by rene on Sat Aug 04, 2018 1:29 pm, edited 1 time in total.

User avatar
catweazel
Level 16
Level 16
Posts: 6983
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Why use ssh with local connections?

Post by catweazel » Sat Aug 04, 2018 7:36 am

rene wrote:
Sat Aug 04, 2018 7:22 am
catweazel wrote:
Sat Aug 04, 2018 4:05 am
In the thread above, the OP appears to be using rsync with ssh to sync two locally attached drives, though I concede that isn't necessarily true.
Indeed it is not; he specifies --rsh=ssh but only when either source or destination is remote does rsync in fact use the configured remote-shell transport. With local sources and destinations -- and that is very much including on network-mounted drives such as NFS-mounted ones: once mounted they're to rsync simply local -- no remote-shell transport is involved; as far as it itself is concerned, rsync uses simple copies.

Once one or both of source or destination is legitimately non-local, using ssh does make some sense even on a private LAN. Foregoing its daemon mode, rsync needs a remote-shell and while that could be for example plain rsh instead of ssh, any remote-shell implementation other than ssh has by now fallen out of grace. That is, although the s(ecure) part of ssh may be pointless on a private LAN, the sh(ell) part is not.

Given a personal disdain for "secuwity" as a substitute for having a clue, I stuck with rsh/rlogin for the longest time on my local LAN but stopped doing so one or two distributions ago when I needed ssh anyway for actual remote remote-shell and installing rsh needed specific scrounging around to find out which BSD-like package the specific distribution-of-the-day had relegated it to -- or IIRC in fact since on one of the used distributions that seldomly used package started bombing out

I see that on a standard Mint install rsh in fact IS ssh unless you install e.g. rsh-client which confuses things a bit, but also note you do not in fact need the "--rsh=ssh" parameter anyway since ssh is the default remote-shell transport on Debian/Ubuntu/Mint. Specifying that option does nothing magical; not even anything "secuwe".
Many thanks, rene, for clearing that up. Your reply was comprehensive, and appreciated.
Caution: Dancing Wu Li Master and Official curmudgeon-in-chief

User avatar
Portreve
Level 6
Level 6
Posts: 1282
Joined: Mon Apr 18, 2011 12:03 am
Location: Florida
Contact:

Re: Why use ssh with local connections?

Post by Portreve » Mon Aug 06, 2018 12:04 pm

Well, catweazel, back when I still had a dedicated fileserver set up, I used ssh because that's the only way I had to get onto the box. I used Cinnamon's own built-in network drive capabilities for that. I've heard of NFS but honestly I don't know anything about it.
Everything is in hand. With this tapestry... and with patience, there is nothing one cannot achieve.

No hamsters were harmed in the authoring of this post.

sgtor
Level 3
Level 3
Posts: 139
Joined: Sat May 13, 2017 9:39 pm

Re: Why use ssh with local connections?

Post by sgtor » Tue Aug 14, 2018 12:57 pm

There are at least two reasons I can think of to use SSH on a LAN.
The first one is a user who knows it's more secure and has read it's best to use it for security and not understanding that being behind a NAT is most likely going to be secure enough.

The second one would be someone or some company or organization who wants or needs to be on the paranoid end of the security scale thus they always employ every layer of security available to them.

If you think it's not possible for a hacker to find a way breach a NAT firewall and set up a sniffer to capture plain text passwords going over telnet on a LAN then I'm sorry to say it's possible.

On the other end of SSH security you have the Linux/Ebury rootkit that spreads from machine to machine on every SSH connection. Thankfully it's easy enough to check for ebury but of course that doesn't apply for zero day changes.

Post Reply

Return to “Chat about Linux”