Operating System - Linux
1830204 Members
14943 Online
109999 Solutions
New Discussion

Re: mount window share to linux

 
John Guster
Trusted Contributor

mount window share to linux

mount -t smbfs /// /tmn where /tmn is a directory on linux.
It does not need provide username/password. What steps need be taken both in window and linux sides? As it always asks for password if as root on linux issue this command.
Thanks.
8 REPLIES 8
Steven E. Protter
Exalted Contributor

Re: mount window share to linux

Shalom,

The reason is the mount command requires root privileges on Linux.

After providing the root password you will be prompted for a Windows user and password.

It is possible though improbably that the Linux systems administrator will use sudo and give you the ability to run mount. See your friendly local neighborhood Linux admin for more on this.

SEP
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
John Guster
Trusted Contributor

Re: mount window share to linux

the command is surely executed as root on linux. I guess without provide username=xxx,password=xxx in the command line, it assumes the superuser on the window and ask for window superuser's password.

I am looking for any possibility that without provide window account, just that command leads to mount window share to linux

The point is mount/umount will be in a script. No one wants password hard coded in the script.
Ivan Ferreira
Honored Contributor

Re: mount window share to linux

You should use "-o guest", but this information I recently found and it's interesting:

Mounting shares at logon time

If you want to automatically mount shares at user logon time the only way I found is doing it with the pam_mount module. It is the only way to do an authenticated mount without requiring the user to store the password in a file or entering it on a terminal.

http://pam-mount.sourceforge.net/

Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Vipulinux
Respected Contributor

Re: mount window share to linux

Hi John

Use the following command:

moutn -t smbfs -o username=windows_domain\windows_user password=win_user_password //windows_server/windows_share /tmn

You can put this in /etc/rc.local so that when ever server boots the share is mounted

Hope this helps

Cheers
Van den Broeck Tijl
Valued Contributor

Re: mount window share to linux

On latter linux kernels (I believe since 2.6.19 somewhere) "smbfs" is no longer supported and therefore will not work. You must use it's new name "cifs" (well relatively new, MS renamed SMB to CIFS back in 1996 or so).
Rob Leadbeater
Honored Contributor

Re: mount window share to linux

Hi,

You could put the windows credentials into a file that is only readable by root (chmod 400), and then use the credentials=file.txt option to smbmount.

# man smbmount

for more information.

That should hopefully keep the security people happy...

Hope this helps,

Regards,

Rob
John Guster
Trusted Contributor

Re: mount window share to linux

mount -t smbfs -o username=test //windowserver/share /mnt after provide the passwd, it gives error: session setup failed:ERRSRV - 2240.
What setup does this require? and on which side, UNIX or Window?
Arnd Kohlen
Advisor

Re: mount window share to linux

Try this line in your fstab:

//server/share /tmn smbfs auto,user,credentials=/root/.passwords/.smbpasswd

The credentials-file (/root/.passwords/.smbpasswd) must have this entries:

username=windows-domain\username
password=secret

I don't have it as root but you might give it a try to have it mounted on startup (if you didn't already solve this).

Regards,
Arnd