LakesProse
March 19th, 2009, 07:49 PM
[So I roamed Google and Ubuntu forums for someone who had a truly similar question to mine but found none, so here it goes. It's quite a long post, sorry for that! I am trying to figure out if I've left out any security concerns]
So I've got myself Ubuntu 8.10 installed and I am implemented Samba sharing over SSH. From a Windows client, this is how it happens.
A .bat file loads putty with a profile and RSA key.
That profile is configured to tunnel local connections from port 139 to server's port 139.*
That profile uses a user called (let's say) 'brutus'.
On the server, brutus has shell set to /bin/false.**
Also server-side, sshd_config uses the PermitOpen option to only allow forwarding to a certain IP address and certain port.
The samba share is pointed towards /media/share which is a partition (rather, it's a HDD) by itself. That partition is mounted in fstab with the noexec option.
That /media/share is also being incrementally backed up using rsync.
*Actually, Windows need a loopback adapter created to bind to locally. Also, for some reason, forwarding the connection to localhost on the server didn't work, I had to use the server's IP address on LAN. So it's more like 10.0.0.1:139 to 192.168.0.106:139.
**since shell=/bin/false, putty must use -N option when called to not actually request a shell and only ask to authorize to permit port forwarding.
ALL RIGHT! So, that's about it. Ssh server is secure in itself I'd think, changed default port, only allows ssh2 connections, only allows rsa authentication, exhaustive list of allowed users to login, root login disabled, OSSEC's supposed to handle iptables, firewall only forwards ssh's port.
I see 2 possible flaws:
The RSA key is not really secure. Since it's resting on a machine at all times, it's relatively out in the open. But I figure it's not that bad. Worst case scenario, someone gets the key, gets in the system and deletes all my files (backups, yeah!, saved!) or fills up all available space (incremental backups, yeah!). Since the drive is mounted as noexec, no problem.
I know samba connects using smb over netbios or smb over tcp/ip directly and I know associated ports are 139 and 445. I'm just wondering, can someone do any damage on my network even though I restricted forwarding to port 139 ?
Sorry again for the long post, any input (or actually having read all that) is appreciated.
So I've got myself Ubuntu 8.10 installed and I am implemented Samba sharing over SSH. From a Windows client, this is how it happens.
A .bat file loads putty with a profile and RSA key.
That profile is configured to tunnel local connections from port 139 to server's port 139.*
That profile uses a user called (let's say) 'brutus'.
On the server, brutus has shell set to /bin/false.**
Also server-side, sshd_config uses the PermitOpen option to only allow forwarding to a certain IP address and certain port.
The samba share is pointed towards /media/share which is a partition (rather, it's a HDD) by itself. That partition is mounted in fstab with the noexec option.
That /media/share is also being incrementally backed up using rsync.
*Actually, Windows need a loopback adapter created to bind to locally. Also, for some reason, forwarding the connection to localhost on the server didn't work, I had to use the server's IP address on LAN. So it's more like 10.0.0.1:139 to 192.168.0.106:139.
**since shell=/bin/false, putty must use -N option when called to not actually request a shell and only ask to authorize to permit port forwarding.
ALL RIGHT! So, that's about it. Ssh server is secure in itself I'd think, changed default port, only allows ssh2 connections, only allows rsa authentication, exhaustive list of allowed users to login, root login disabled, OSSEC's supposed to handle iptables, firewall only forwards ssh's port.
I see 2 possible flaws:
The RSA key is not really secure. Since it's resting on a machine at all times, it's relatively out in the open. But I figure it's not that bad. Worst case scenario, someone gets the key, gets in the system and deletes all my files (backups, yeah!, saved!) or fills up all available space (incremental backups, yeah!). Since the drive is mounted as noexec, no problem.
I know samba connects using smb over netbios or smb over tcp/ip directly and I know associated ports are 139 and 445. I'm just wondering, can someone do any damage on my network even though I restricted forwarding to port 139 ?
Sorry again for the long post, any input (or actually having read all that) is appreciated.