Live Chat & Podcast at 1:00PM Eastern on Sunday!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Linux and Unix
Tag Cloud
access acer asus bios bsod computer crash desktop driver drivers error ethernet excel freeze gaming hard drive hardware hdmi internet laptop malware memory modem monitor motherboard network printer problem ram registry router security slow software sound toshiba trojan ubuntu 11.10 uninstall usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Operating Systems > Linux and Unix >
Samba: Cannot write to share / Allow internal IP's only

Reply  
Thread Tools
chinc's Avatar
Member with 52 posts.
 
Join Date: Oct 2003
04-Nov-2003, 03:42 PM #1
Samba: Cannot write to share / Allow internal IP's only
Just like it says..

I can't write to any of my shared folders. Getting irritating! I tried turning "allow guest" and "writeable" but neither worked. I can browse, but I really badly need to write. The file is within /var - is this a problem?

Secondly I would like to not allow any IP's but the internal network for security.
Squashman's Avatar
Trusted Advisor with 18,706 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
Experience: Bocks of Rox
05-Nov-2003, 02:14 AM #2
What are the permissions on /var

drwxr-xr-x 23 root root 4096 Aug 19 13:19 var

Is this server sitting behind a Router?
What version of Linux are you running?
Do you know if you have a firewall running on the server?
Do an iptables -L as root. Post the info if any back here.

Using a router with a NAT/Firewall or a firewall running on the server would be two ways to block it from the Internet.

Last edited by LwdSquashman; 05-Nov-2003 at 02:21 AM..
codejockey's Avatar
Senior Member with 1,410 posts.
 
Join Date: Feb 2002
05-Nov-2003, 03:49 AM #3
I think the Squashman has already asked all the right questions for your write problem. You can use the hosts allow and hosts deny keywords in the [global] section of your smb.conf file to specify those addresses that you will accept connections from. For example, I use:

hosts deny = ALL
hosts allow = 172.16.0. 172.16.1. 127.

This (first) denies all connections (hosts deny) and then allows connections for IP addresses beginning with 172.16.0 and 172.16.1 (the machines on my local network) as well as the localhost (127.*).

Hope this helps.
__________________
The slowest component still sits at the keyboard.
Squashman's Avatar
Trusted Advisor with 18,706 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
Experience: Bocks of Rox
05-Nov-2003, 04:34 AM #4
Been a long time since I used Samba, I dont have it installed on my server curretnly, so I could not remember if that was in the conf file or not.

My biggest fear is that the server is directly connected to the internet without a firewall or natted behind a router.
chinc's Avatar
Member with 52 posts.
 
Join Date: Oct 2003
05-Nov-2003, 05:56 PM #5
First off I use a firewall.. there isn't one on the machine, but I have an external box.

Secondly, I tried changing the permissions to 777 and that didn't help.
codejockey's Avatar
Senior Member with 1,410 posts.
 
Join Date: Feb 2002
06-Nov-2003, 01:51 AM #6
It's possible your smb.conf file is missing some entries. For example, do you have a section similar to the following:

[public]
comment = Public Stuff
path = /var
public = yes
writable = yes
printable = no

If you post your smb.conf file, that might be helpful.

Hope this helps.
Squashman's Avatar
Trusted Advisor with 18,706 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
Experience: Bocks of Rox
06-Nov-2003, 01:52 AM #7
Quote:
Originally posted by chinc:
First off I use a firewall.. there isn't one on the machine, but I have an external box.

Secondly, I tried changing the permissions to 777 and that didn't help.
Usually not a good idea. I assume the owner and group are still root. Try changing the group to a group that has your users in it.

Could you post the relevant portions of your samba config file.
chinc's Avatar
Member with 52 posts.
 
Join Date: Oct 2003
06-Nov-2003, 12:48 PM #8
[file_server]
comment = xxxxxxxx
locking = no
writeable = yes
public = yes
path = /var/www/html/files

I changed the group to a group my users are in..
Squashman's Avatar
Trusted Advisor with 18,706 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
Experience: Bocks of Rox
06-Nov-2003, 01:10 PM #9
Quote:
Originally posted by chinc:
[file_server]
comment = xxxxxxxx
locking = no
writeable = yes
public = yes
path = /var/www/html/files

I changed the group to a group my users are in..
so the permissions on the files directory are this:

drwxrwxr-x 23 root group 4096 Aug 19 13:19 files
chinc's Avatar
Member with 52 posts.
 
Join Date: Oct 2003
06-Nov-2003, 01:20 PM #10
After doing a chmod -R 777 files I was able to write to the directories.. but I assume this isn't the safest way to do things?
Squashman's Avatar
Trusted Advisor with 18,706 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
Experience: Bocks of Rox
06-Nov-2003, 01:24 PM #11
What about 774
chinc's Avatar
Member with 52 posts.
 
Join Date: Oct 2003
06-Nov-2003, 01:28 PM #12
Nope...

774 = no write.
Squashman's Avatar
Trusted Advisor with 18,706 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
Experience: Bocks of Rox
06-Nov-2003, 01:32 PM #13
Open up a shell prompt

cd /var/www/html

ls -l

copy and paste. I just want to see it for myself.
chinc's Avatar
Member with 52 posts.
 
Join Date: Oct 2003
06-Nov-2003, 01:58 PM #14
drwxr-xr-x 2 www www 4096 Oct 30 22:03 addon-modules/
-rw-r--r-- 1 www www 1406 Mar 4 2003 favicon.ico
drwxrwxrwx 8 root www 4096 Nov 6 10:28 files/
-rw-r--r-- 1 www www 6295 Mar 4 2003 index.shtml
-rw-r--r-- 1 www www 153 Mar 4 2003 optim.html
-rw-r--r-- 1 www www 609 Mar 4 2003 platform.html
Squashman's Avatar
Trusted Advisor with 18,706 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
Experience: Bocks of Rox
06-Nov-2003, 02:08 PM #15
So all your users are in the group www
Reply

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 10:29 PM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.