LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices



Reply
 
Search this Thread
Old 12-05-2003, 11:33 AM   #1
jeopardyracing
Member
 
Registered: Sep 2003
Posts: 175

Rep: Reputation: 30
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"
 
Old 12-05-2003, 02:29 PM   #2
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 47
Have a look in the smb.conf file for create mask & directory mask and make them 777
 
Old 12-05-2003, 04:58 PM   #3
jeopardyracing
Member
 
Registered: Sep 2003
Posts: 175

Original Poster
Rep: Reputation: 30
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?
 
Old 12-06-2003, 12:39 AM   #4
jeopardyracing
Member
 
Registered: Sep 2003
Posts: 175

Original Poster
Rep: Reputation: 30
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!
 
Old 01-09-2004, 01:01 PM   #5
artur
Member
 
Registered: Apr 2002
Location: Illinois, US
Distribution: Red Hat, Fedora, Yellow Dog, Debian, FreeBSD, Embedix
Posts: 106

Rep: Reputation: 15
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.
 
Old 01-09-2004, 02:20 PM   #6
jeopardyracing
Member
 
Registered: Sep 2003
Posts: 175

Original Poster
Rep: Reputation: 30
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!
 
Old 01-09-2004, 10:21 PM   #7
artur
Member
 
Registered: Apr 2002
Location: Illinois, US
Distribution: Red Hat, Fedora, Yellow Dog, Debian, FreeBSD, Embedix
Posts: 106

Rep: Reputation: 15
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.
 
Old 01-10-2004, 12:33 AM   #8
jeopardyracing
Member
 
Registered: Sep 2003
Posts: 175

Original Poster
Rep: Reputation: 30
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
 
Old 01-10-2004, 12:35 AM   #9
jeopardyracing
Member
 
Registered: Sep 2003
Posts: 175

Original Poster
Rep: Reputation: 30
Are you a fellow Linux & Mac user? I realize I'm a rare beast so it'd be interesting to compare notes!
 
Old 01-10-2004, 01:26 AM   #10
artur
Member
 
Registered: Apr 2002
Location: Illinois, US
Distribution: Red Hat, Fedora, Yellow Dog, Debian, FreeBSD, Embedix
Posts: 106

Rep: Reputation: 15
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
 
Old 01-10-2004, 10:11 AM   #11
jeopardyracing
Member
 
Registered: Sep 2003
Posts: 175

Original Poster
Rep: Reputation: 30
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)?
 
Old 01-10-2004, 11:02 AM   #12
artur
Member
 
Registered: Apr 2002
Location: Illinois, US
Distribution: Red Hat, Fedora, Yellow Dog, Debian, FreeBSD, Embedix
Posts: 106

Rep: Reputation: 15
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
 
Old 01-10-2004, 02:26 PM   #13
jeopardyracing
Member
 
Registered: Sep 2003
Posts: 175

Original Poster
Rep: Reputation: 30
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
 
Old 01-10-2004, 02:37 PM   #14
jeopardyracing
Member
 
Registered: Sep 2003
Posts: 175

Original Poster
Rep: Reputation: 30
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
NTFS network share zchoyt Linux - Newbie 4 08-29-2004 08:17 AM
How do I share a drive on network vash_stewy Linux - Networking 4 04-11-2004 11:55 PM
network share tpark Linux - Networking 1 02-25-2004 04:10 PM
CDROM Network share DiBosco Linux - Networking 2 06-12-2003 03:48 PM
Cannot mount an NT network share pharpe Linux - Networking 3 04-29-2002 08:58 AM


All times are GMT -5. The time now is 03:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration