Johan Lindquist <(E-Mail Removed)> wrote in message news:<85q1f1-(E-Mail Removed)>...
> So anyway, it was like, 11:51 CET Feb 02 2004, you know? Oh, and, yeah,
> C3 was all like, "Dude,
>
> >> Call me old-fashioned, but.. mounting smb (or any) shares over the
> >> internet? You do have a /really/ tight firewall setup on that box
> >> to only allow the machines you expect to reach you, right?
> >
> > Yes. SSH access is restricted to a few IP subnets where I know I'll
> > be, and only at the times I'll be there. I'm also about to start
> > trialing an even more secure firewall.
>
> (I'm assuming you mean "SMB".)
>
> > I've come up with a trick - and I don't know whether it will
> > work - that requires you to probe the ports of the machine in a
security tricks that are not known to work simply don't
> > certain order within a certain timeframe to get access (but this is
> > offtopic).
>
> You're not the first person to come up with the idea (well, you might
> be, if you called it "port knocking").
>
> <http://www.linuxjournal.com/article.php?sid=6811>
>
> It's an interesting concept, but personally I feel it's alittle over
> the top for a non-professional setting.
>
> >> Not to mention that you'll be wasting a whole lot of precious
> >> bandwidth to accommodate a protocol which is not exactly.. slim.
> >
> > I know that SMB is not exactly the most efficient protocol, but I'm
> > only doing this for convenience. I will not be transferring large
> > files. More like running programs remotely that write to config/log
> > files in one place.
>
> Convenience is one of the biggest culprits when it comes to creating
> security problems, imho.
>
> >> What is the purpose of this sharing? You might want to consider
> >> using something like sftp (included with most ssh clients) instead
> >> to fetch files in a more secure and less distaster-inviting manner.
> >
> > Convenience. I already use scp to transfer files that don't need to
> > be updated often. What is so disaster-inviting about running SMB
> > over SSH so I can have live access to my config files? This is what
> > I'll be doing.
>
> As for smb over ssh, I dunno, I don't even know if it can be done (it
> probably can). As for actually mounting file systems (read-write, no
> less!) over the internet, it's just so.. wrong. Especially nfs, I
> guess smb would be slightly less stupid security-wise since it's at
> least partially encrypted.
>
> What config files (or log files, for that matter) is it that you need
> to be able to update remotely in this manner? I'm quite curious,
> since I can't figure out a good enough reason to require this sort of
> procedure.
Afraid I must concur with Johan's scepticism re: both the "dangers of
convenience" and the need to mount partitions and/or shares across the
internet. When it comes to outside access to a system, if you don't
_know_ it is safe, it is _not_ safe.
The port knocking depends largely on security-thru-obscurity. Anyone
who does get in will quickly clean up the logs to hide they were ever
there. The fact that you will be connecting from only a few subnets
is also of dubious help -- it only reduces the range of valid IP's
accepted. Besides, without an acknowledgement mechanism, there is no
way know to be certain that the connection attempts will arrive in the
order that you sent them -- this whole approach depends on the
arbitrary chacteristics of the net, not on any protocols or mandated
net features you can rely on.
Then there is the problem of NATing and or proxying _out_ of the
remote site(s). In fact, most sites will heavily restrict outgoing
connect requests to only a few "legit" priviledged ports. You may not
even be able to use sFTP (but that is less likely). And some sites
consider any unauthorized tunneling out of the site as a clear
violation of policy. And then there is your ISP's traffic policies
re: what appears as automated port scanning.
Re: SMB
Let us count the ways this service can/is abused to gain root/admin
access. It keeps several ports open that provide "direct" access to
security info unless _very_ carefully set up and monitored. It was
never designed as a secure protocol but is embedded in the very stuff
that provides security/authentication. A different design but the
same results when using NFS over a public, untrusted network (a.k.a.
the Internet).
Last, but certainly not least. Of all the files to be accessed over
the Internet, config files and logs are certainly, absolutely, without
a question, no doubt about it the _very_ worst thing you can do. The
only thing worse is to make password and shadow files with world
read/write access.
If after all this you're still wanting/needing access as you describe,
you really should look into setting up a VPN. Your DIY approach will
never be confirmable as safe and once it fails provides an almost
instant access route to admin/root (else how would _you_ get access to
those log and config files?). At least with VPN you'll be working in
several layers of security/encryption.
just my 2c's
prg
email above disabled