
6th June 2007, 23:49
|
|
Junior Member
|
|
Join Date: Jun 2007
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
LAMPS: Is it ok to run SMB on a Web Server?
I have two computers:
A) a Kubuntu Desktop machine that I do all of my work on
B) a Ubuntu Server that runs a LAMP stack and nothing else.
The server will be publicly accessible on the internet. Since the server is on the same LAN and is literally 15 feet away from my desktop machine, it seems absurd to FTP the files across the internet to get to a computer on the other side of the room.
I was thinking that it would make sense to share the web root of the server using SMB and then mount the share on my desktop computer, so that I could edit the files directly.
Is it a stupid idea to do this? Ie, Does that open up security vulnerabilities?
Are there better alternatives?
Thank you for your advise.
|

7th June 2007, 01:07
|
|
Member
|
|
Join Date: Mar 2006
Posts: 60
Thanks: 4
Thanked 3 Times in 3 Posts
|
|
Actually it is not absurd to use ftp to get your files from your server.
I am assuming that you have a router the connects both of your computers to the net. In that case, when you want to access your files, just type in your internal ip address of the server. This is probably in the form of 192.168.1.x. Use ifconfig on your server to find out your ip address.
I believe that some routers are also intelligent enough to figure out when a request is being made from within the network, and they treat it as local. This means that even if you access your server though a domain name, such as yourdomain.com, and you're on your home network, the router will figure this out, and connect you with your server directly, bypassing your service provider.
As for samba, you can configure it for authentication, and as long as you don't open up the samba port to the outside world, it can be relatively safe.
cheers
|

12th June 2007, 00:35
|
|
Junior Member
|
|
Join Date: Jun 2007
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks Aqua,
Right now only ports 80, 81, and 443 are open tot he outside. (I don't know if samba uses a port or not). The trick to getting it to work right seems to be making your samba user a member of the group that owns the web file(s).
As long as the last digit isn't a seven, the files are safe? Ie. "chmod xx5"
|

12th June 2007, 14:03
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,665
Thanks: 1,896
Thanked 2,593 Times in 2,444 Posts
|
|
The values are as follows:
4 = read
2 = write
1 = execute
So 5 means "read + execute". 6 would mean "read + write", and 7 "read + write + execute".
|

13th June 2007, 02:40
|
|
Junior Member
|
|
Join Date: Jun 2007
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I pretty much understand how permissions work on a single system basis, but I'm having difficulty understanding how they work across two machines.
If i go to \\192.168.3.19 (the servers IP) and login as 'smusr' with my password,
I can read and write without a problem, since 'smbusr' a user on the server is a member of the 'web1' group, and the files are set to 575.
This is where it get's weird: If I mount the share \\192.168.3.19\web at /web on my local machine, using 'smbusr' and the password, it mounts, but does so as read only. Even though that user does have write access as far as the server is concerned. It seems like my desktop computer is trying to add permissions on top of a network resource that already has permissions.
|

14th June 2007, 20:51
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,665
Thanks: 1,896
Thanked 2,593 Times in 2,444 Posts
|
|
Is smbusr the owner of the files/directories? Are the permissions set to 575 or 755?
|

15th June 2007, 04:42
|
|
Junior Member
|
|
Join Date: Jun 2007
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
the folder /var/www/web1 (in question) is owned by 'web1_joanne' in the group web1.
'smbusr' is a member of the 'web1' group.
It works fine when I conect using samba ie.. 'smb:\\192.168.3.19\web' but when I mount the share to my local directory tree using fstab, i loose write permissions.
My fstab entry is:
Code:
//192.168.3.19/www /web cifs user=smbusr%SMBPASS,uid=LOCALUSR,gid=LOCALUSRGRP 0 0
*please note that words in capitals are replacements for their actual value.
|

16th June 2007, 13:26
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,665
Thanks: 1,896
Thanked 2,593 Times in 2,444 Posts
|
|
You could try to add rw to the fstab entry, e.g.:
Code:
//192.168.3.19/www /web cifs user=smbusr%SMBPASS,uid=LOCALUSR,gid=LOCALUSRGRP,rw 0 0
|

17th June 2007, 11:56
|
|
Junior Member
|
|
Join Date: Jun 2007
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Still won't allow write access... When I mount it to /web and look at the permissions tab in properties, it says the owned is '10001' group '10001'.
Is that user/group 10001 on the server or on my local machine? My local machine doesn't have a user or system process with that number.
|

18th June 2007, 11:34
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,665
Thanks: 1,896
Thanked 2,593 Times in 2,444 Posts
|
|
Quote:
|
Originally Posted by lightnb
My local machine doesn't have a user or system process with that number.
|
I guess that is the problem. Create the same user/group on the local system with the uid/gid 10001.
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +2. The time now is 20:08.
|
|
Recent comments
14 hours 20 min ago
21 hours 1 min ago
1 day 52 min ago
1 day 2 hours ago
1 day 10 hours ago
1 day 20 hours ago
1 day 21 hours ago
2 days 46 min ago
2 days 5 hours ago
2 days 5 hours ago