LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Network share - how get 777? (https://www.linuxquestions.org/questions/linux-networking-3/network-share-how-get-777-a-122964/)

jeopardyracing 12-05-2003 10:33 AM

Network share - how get 777?
 
Hi everyone! I just got an Apple iBook G4 and I've managed to network my Red Hat power Dell Latitude notebook to it as an SMB share.

I'm logged into the Dell as a normal user (not root) and I run a simple shell script using "smbmount" to mount the Apple's shares. The thing is, even if I log in as root and create a folder with 777 permissions, then go back in as a normal user, when I mount the Apple to that new folder the permissions revert to 755! I can log out as the normal user and log back in as root and then write to the Apple's drive, but I can't stay where I am and do so (thought I can read files on the Apple just fine.)

How can I mount the Apple's drives so they are writable outside of root? I know I can put a line Fstab to do so but I don't want to since both machines are laptops and I need to mount and unmount the Apple withing working sessions on the Dell.

Thanks!

Rich Hoyer
Dell Latitude D600
Red Hat 9.0
Apple iBook G4
OS X 10.3 "Panther"

peter_robb 12-05-2003 01:29 PM

Have a look in the smb.conf file for create mask & directory mask and make them 777

jeopardyracing 12-05-2003 03:58 PM

Samba running?
 
Thanks for the help. I went into smb.conf and changed the uncommented the following lines in the smb.conf file's examples at the bottom of how to share a directory:

;[my share]
; comment = Mary's and Fred's Stuff
yadda yadda
; create mask = 0765

I changed their little example here to the directly I want to be able to write to in my normal logon but no luck.

By the way, I am not running Samba (that I know of) when I mount the Apple's shares. I notice that when I mount a Windows share in the Apple I don't need to start either. If that's the case, would changing the smb.conf file do anything?

jeopardyracing 12-05-2003 11:39 PM

Found the answer
 
For anyone else who would like the solution to this problem, I found the answer. The answer was

smbmount //computer/sharename /directory/mountfolder -o dmask=777,fmask=777

Works perfectly; full read write and execute permissions outside of root. This is secure enough only because use it only on a two PC network behind a firewall! If I only want to read from the sharedrive and will not want to put it at ris, I will probably create a second shell script with the default read only permissions!

artur 01-09-2004 12:01 PM

Re: Found the answer
 
Quote:

Originally posted by jeopardyracing
If I only want to read from the sharedrive and will not want to put it at ris, I will probably create a second shell script with the default read only permissions!
You do realize, that the only protection this offers is from yourself, right? Just because you mount the share on your Dell read-only does not turn it into a read only share served by the apple. Your G4 still makes it avaliable with full access to anyone else on your network. Good thing indeed that you're behind a firewall.

If you're allowing passwordless acces to the entire drive now, I'd recommend setting up some passwords and a separate directory shared on G4.

jeopardyracing 01-09-2004 01:20 PM

Yup
 
Yeah, I realize that the permissions on the Dell have nothing to do with the Apple's permissions. It's a home two computer network, so I turn off file sharing on the Apple when I leave home!

artur 01-09-2004 09:21 PM

Re: Yup
 
Quote:

Originally posted by jeopardyracing
Yeah, I realize that the permissions on the Dell have nothing to do with the Apple's permissions. It's a home two computer network, so I turn off file sharing on the Apple when I leave home!
Just making sure... :)

As long as you only use your G4 at home, you're safe behind the firewall. You don't have to turn off file sharing, unless you map smb or atalk ports on your router to point to G4's IP.

As far as fstab entry for mounting shares, you could use the "noauto" option to not mount the share during bootup, but still have it defined so that you could just type mount /mnt/g4 instead of that long smbmount command.

jeopardyracing 01-09-2004 11:33 PM

Awesome!
 
I will try that!!! Holy cow would that save me some time.

Right now I have a shell script that mounts it but what a pain to open a terminal su, then password, then the whole directory path to the shell script. I will definately check out that option.

Thanks!

Rich

jeopardyracing 01-09-2004 11:35 PM

Are you a fellow Linux & Mac user? I realize I'm a rare beast so it'd be interesting to compare notes!

artur 01-10-2004 12:26 AM

Quote:

Originally posted by jeopardyracing
Are you a fellow Linux & Mac user? I realize I'm a rare beast so it'd be interesting to compare notes!
Linux, Mac, Windoze, Amiga, Atari... if it has a CPU I wanna play with it :) Don't worry, there's more of us out there.

I'm afraid you'll still have to open terminal to mount the shares, but if you figure out the sudo thingy you won't have to do su anymore. That of course unless someone clever comes up with a script tied to an icon on your dock to mount the volume. Then you'll just click on in and boom-there-it-is :)

jeopardyracing 01-10-2004 09:11 AM

Linux and Mac?
 
Will an entry for a network share work by making an FSTAB noauto entry for both the Mac and my Red Hat machine? I was thinking of having the entry on the Linux machine's FSTAB table since I use Applescript on the Mac to quickly mount network shares. I used XCode to create a set of desktop buttons that I just click on for any specific share (it's pretty cool - I also created a Carbon program to toggle Windows Sharing on and off with the touch of one button so I don't have to navigate through all the menues to do it manually. I LOVE that Applescript can script the OS X GU! How rad is that??)

What would be the correct syntax for an FSTAB entry on the Red Hat machine for the Mac's network mount (using noauto)?

artur 01-10-2004 10:02 AM

Re: Linux and Mac?
 
Quote:

Originally posted by jeopardyracing
Will an entry for a network share work by making an FSTAB noauto entry for both the Mac and my Red Hat machine?
It should.

Quote:

I was thinking of having the entry on the Linux machine's FSTAB table since I use Applescript on the Mac to quickly mount network shares. I used XCode to create a set of desktop buttons that I just click on for any specific share (it's pretty cool - I also created a Carbon program to toggle Windows Sharing on and off with the touch of one button so I don't have to navigate through all the menues to do it manually. I LOVE that Applescript can script the OS X GU! How rad is that??)
That is really cool! Can you post your code? I'd like to know how you did it.

Quote:


What would be the correct syntax for an FSTAB entry on the Red Hat machine for the Mac's network mount (using noauto)?

Code:

\\g4\share  /mnt/g4  smb  noauto,dmask=777,fmask=777  0 0
should do the trick, but don't take my word for it, do the Right Thing and RTFM ;)

jeopardyracing 01-10-2004 01:26 PM

XCode for GUI
 
This took a bit of work, to be honest! The problem is that the native OS X tools for identifying any given GUI object's hiarchy is pretty bad (you may have noticed this if you've tried to use it.)

As per some of the X Code KBase articles, I downloaded a $20 utility called UI Element Inspector. It's a lot more intuitive but there was a catch: it was still wrong about the names of the objects (checkboxes) I was targeting. So I rented a movie and as I watched I fooled with all kinds of different syntax in Applescript until I figured it out. It turned out that the trick was to first have Applescript select the row of the object you are targeting, and only then have it try to interact with the check box itself. After several hours of experimenting, here was the answer. Note that this script turns on both Windows Sharing and Personal File sharing - to omit the latter (I did in a later version) just omit the relevant subroutine. Also, I am of course just posting the Applescript portion of my little application; I assume you're up on the process for generating the GUI elements to connect to this script in XCode. Finally, this is a toggle - all it does is go check the box on or off depending on whether it was checked before. But it is super cool and nice to have! If you'd like the full App, I could put it in a DMG and email it to you. this script is designed for Panther on my G4 - if you have Panther but an older processor, and if you find the script fails, increase the amount of time in each of the delays I built in. Compared to my Linux Dell this G4 is SLOW and if the delays were too small or missing the script would look for an object that had yet to render on the screen.

tell application "System Preferences" to activate
-- may not need to activate application

tell application "System Events"
if (system attribute "sysv") < 4144 or UI elements enabled then
tell application process "System Preferences"
tell window "System Preferences"
delay 1
tell scroll area 1
tell button "Sharing"
delay 1
click
delay 1
tell application "System Events"
tell application process "System Preferences"
tell window "Sharing"
delay 2
tell tab group 1
tell scroll area 1
tell table 1
select row 2
tell row 2
tell checkbox 1
delay 2
click
end tell
end tell
end tell
end tell
end tell
end tell
end tell
end tell
end tell
end tell
end tell
end tell
else
tell application "System Preferences"
activate
set current pane to pane "com.apple.preference.universalaccess"
beep
display dialog "GUI Scripting is not enabled." & return & return & "Check \"Enable access for assistive devices\" in the Universal Access preference pane (authentication is required), then run this script again." with icon stop buttons {"OK"} default button "OK"
end tell
end if
end tell

delay 3

tell application "System Events"
tell application process "System Preferences"
tell window "Sharing"
tell tab group 1
tell scroll area 1
tell table 1
select row 1
tell row 1
tell checkbox 1
click
delay 1
tell application "System Events"
tell application process "System Preferences"
tell window "Sharing"
tell tab group 1
tell scroll area 1
tell table 1
select row 1
end tell
end tell
end tell
end tell
end tell
end tell
end tell
end tell
end tell
end tell
end tell
end tell
end tell
end tell

jeopardyracing 01-10-2004 01:37 PM

Forgot - here is the code to mount network shares using Applescript - it can just be hooked up to another GUI button. I have my little app load on every log in too so the resulting GUI controls are always in the upper left of my screen. Saves and assload of time. Note that these scripts require that you have a plain text version of another network share's password on your hard drive, but you could in theory omit that part and key it each time. I haven't tried it but I assume Finder would just prompt you for it. Of course I wouldn't take this risk if it were a work computer, but here at home with just two I think it's okay.

tell application "Finder"
mount volume "smb://LOGON_ID:Password@PCNAME/SHARE_NAME"
end tell


All times are GMT -5. The time now is 07:47 PM.