# mounting network share



## pyrojoe333 (Jun 26, 2003)

I'm working on mounting a network shae via the terminal. I need to write a login script. The way this works is every user has a folder on our server so that every time they log in they can save stuff to their folder. I wlould like to mount this foulder via login script so when they log in this folder appears on their desktop. right now I'm using mount_smbfs as my command and it works kinda. if I type: mount_smb -u stu000001 -d my_domain //labserver/student1/stu000001 ./student it mounts //laserver/student1 and excludes the stu000001 folder. I think it might be because this folder is a folder not a share?  what I'm asking is does anybody know how to mount a remote folder or any way to fix this problem other than making the folder a share, and is there a way to do it in command line. OR how would I do it using apple scripts? and how would I set up apple scripts as a login hook?

Jeramiah


----------



## Lycander (Jun 26, 2003)

If it mounts //laserver/student1 then make a sym-link to the stu000001 folder inside that mount. You'll only need to make the sym-link once, then when student1 is mounted the sym-link will resolve properly to the correct folder. This is just one idea, might not be the best.


----------



## WeeZer51402 (Jun 26, 2003)

What are service are you trying to mount through, afp, smb or nfs?


----------



## WeeZer51402 (Jun 26, 2003)

oh nevermind i didnt red you post carefully enough its smb


----------



## profx (Jun 26, 2003)

try writing an apple script

i did


```
tell application "Finder"
	try
		
		mount volume "smb://domain;username@netbios/share"
		
	end try
end tell
```
that will promt for a password if needed or you can set up a .nsmbrc file to bypass the password.

search the forums


----------



## pyrojoe333 (Jun 26, 2003)

that still gives me the same problem. it mounts //labserver/student1 not //labserver/student1/stu000001


----------



## WeeZer51402 (Jun 26, 2003)

is 'stu000001' listed as hidden in /etc/smb.conf?


----------



## Lycander (Jun 26, 2003)

I think you're only exporting student1 in the smb config. So there's 2 ways you can approach this:

* The way I described above, after mounting the student1 folder, check to see if a sym link exists that will point to the user's folder within student1, create it if it doesn't exist.

* Create a script that will update you smb config on the server side. This way whenever you have a new user, or want to run a batch to create many users, it'll update the smb config by adding the student00000# folder to the shares exported. I'm basically saying, make a tool that'll go and make the shares for you rather than manually make them by hand.


----------



## Racer D (Jun 27, 2003)

or for something a bit different

connect to you share. then navigate to the folder you want to get, and make an alias of it on the desktop. now when you click the icon, share will mount automatically if not mounted. for more effect, disable network volumes showng up on your desktop


----------



## pyrojoe333 (Jun 27, 2003)

Right what I want to do is write a script. that will run when my user logs in. the script will look at the users name and find the folder on the server with that same name (i.e. mount //labserver/student1/%username%, or something to that effect). The problem that I'm having is finding the command the will mount the folder. I believe that the problem lies in that the users folder is just that, it's a folder within a share. it's mounting the share but not the folder that I specify. I can't make this folder a share on the server side, I need to figure out how to mount in on the client side.


----------



## pyrojoe333 (Jun 30, 2003)

Is there a way to create an alias to the users folder on the desktop after I've mounted the drive? So then the user logs in, I mount the //labserver/student1 then I create an alias on the desktop that points to stu000001. In applescript or otherwise?


----------



## Lycander (Jun 30, 2003)

ln -sf //labserver/student1/stu000001 ~/Desktop/share

That's the shell command to create a symbolic link to //labserver/student1/stu00001 and put the link on the desktop. "share" will be the name of the alias. I used "//labserver/student1/..." as an example, you'll have to find the absolute path that it's mounted at.


----------



## pyrojoe333 (Jul 1, 2003)

that's exactly what I've been looking for thank you.


----------

