Operating System - Linux
1824363 Members
3230 Online
109669 Solutions
New Discussion юеВ

Mounting NT network shares via /etc/fstab

 
Andrew Kaplan
Super Advisor

Mounting NT network shares via /etc/fstab

What would the correct syntax be for mounting a Windows NT share via the /etc/fstab file? Thanks.
A Journey In The Quest Of Knowledge
8 REPLIES 8
Stuart Browne
Honored Contributor

Re: Mounting NT network shares via /etc/fstab

//system/share /dest/mount smbfs username=user,pasword=pass 0 0

Same format as every other line.



The source being:
//NTMachine/Share

Destination path:
/mnt/YourMountPath

File System Type:
'smb' of 'smbfs'
(This was introduced by the Samba sources into the kernel years ago. I remember having to grab kernel patches from Samba and recompiling kernels to do this! Once upon a time, you had to use the tools 'smbmount' and 'smbumount' in order to do what you can now do with 'mount -tsmbfs -ousername=blah //machine/share /mount/pint'. This sill uses the 'smbmount' commands in the background, but they don't have to be used explicitly any more)

Options field:
username=WindowsUser,password=UserPassword
(There are of course more options, these are outlined in 'man smbmount')

The last two are the same as always (outlined in 'man fstab').

One long-haired git at your service...
Mark Fenton
Esteemed Contributor

Re: Mounting NT network shares via /etc/fstab

Note that this potentially exposes a user's logon credentials on the NT box to anyone who can read /etc/fstab!

just a word of caution...

Mark
Andrew Kaplan
Super Advisor

Re: Mounting NT network shares via /etc/fstab

Thanks for the reply. I am able to mount the drive but I am running into a permissions issue. The syntax of the mounted drive in the fstab file is //home17/ahk$ /mnt/ahk smbfs username=partners/ahk,password=password 0 0

Is there something wrong with the syntax? thanks.
A Journey In The Quest Of Knowledge
Stuart Browne
Honored Contributor

Re: Mounting NT network shares via /etc/fstab

I'm picking the '/' in the username is causing the issue.

Can you get rid of it? If not, try escaping it (partners\/rhk). I've never tried using a '/' in a username in this purpose.
One long-haired git at your service...
benoit Bruckert
Honored Contributor

Re: Mounting NT network shares via /etc/fstab

Hi,
I agree with Stuart, I think the "/" is the trouble, try this, it should be better:
//home17/ahk$ /mnt/ahk
smbfs username=ahk,password=password,workgroup=partners 0 0
hth
Benoit
Une application mal pans├йe aboutit ├а une usine ├а gaze (GHG)
Andrew Kaplan
Super Advisor

Re: Mounting NT network shares via /etc/fstab

Hi guys,

Thanks for your help. The dropping of the / in the username and adding the workgroup= option enabled the connection to take place.
A Journey In The Quest Of Knowledge
Heiner E. Lennackers
Respected Contributor

Re: Mounting NT network shares via /etc/fstab

the slash '/' is not part of the username, the syntax is:
/// / smbfs username=/,password= , 0 0

example:
//dsysnt3x/c$ /mnt/dsysnt3x/c smbfs username=administrator/dsysnt3x,password=banana01 0 0

Heiner
if this makes any sense to you, you have a BIG problem
Steven E. Protter
Exalted Contributor

Re: Mounting NT network shares via /etc/fstab

Am I to understand that there is no special software running on the NT server at all? All I have to do is mount the share with appropriate login credentials and I have access?

Sounds too easy. It could be useful to me because my office network backup is a Windows 2000 machine that does not have Samba and can't mount the exported NFS systems on my Linux box.

Currently I have the backup server run an ftp script that logs onto filesystem /backups of the Linux box which the user in the script is read only(can't make a back door for the hacker can we?) and that script puts the backup files somewhere where they will get backed up.

Obviously cron makes the backups prior to the runtime of that ftp script.
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com