Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Samba: mapping a linux share under w2k

Status
Not open for further replies.

yahve

Programmer
Nov 14, 2000
159
CA
Hi,

I'm running w2k and COL2.2 . Samba is up and running, I can see shares from any machine on any machine. Under w2k, I have mapped linux shares which are reconnected on logon. What would be the best way to do the same under linux.

I would like my windows shares to be mounted on my linux machine on boot-up.

Thanks.
 
I've always done the reverse but I think what you'll want is the program smbclient as I believe it handles mapping the Windoze machines on the linux side. You could just put this in your boot up script to map them automatically at startup.

Good luck,
GJ
 
Thanks GJ,

Sorry for the confusion: what I want is to mount a share from a w2k machine when my linux box boots up. I can do this by hand using:
smbmount \\\\winhost\share
then I get prompted for the password and then I have to issue a mount /mnt/winshre command.

The problem is that I don't know how to put those 3 commands in a script so that I don't have to manually enter them. I was thinking of using a shell script... would you know how I should write it (syntaxe)?

Thanks
 
You could just put these at the end of the /etc/rc.d/rc.local file. This file is run after all of the other initialization scripts and you can add the commands at the end of it.

Let me know if you have any trouble,
GJ
 
Hi GJ,

I thought about something like that, the problem is that after the smbmount \\\\winhost\share command, I would need to output the password and an 'enter' then, while at the smb prompt I would need to issue the following command:
mount /mountpoint.

I do not know how to do this (ie wait for the first command to prompt me, then output the proper response and then output another command) from a script.

Any thought on how to do this from a script?

Thanks.
 
Try the following command in the startup script:

smbmount \\\\winhost\\share mountpoint -o password=********

AV
tnedor@yahoo.com
 
Thanks TR,

I had tried that already but it did not worked. So I went back to the man page and came up with:

smbmount \\\\winhost\\share -U username%passwd
-c 'mount /mntpoint'

and it works.

thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top