[Samba] Mounting Samba Share using linux login

This is a discussion on [Samba] Mounting Samba Share using linux login within the Samba forums, part of the Networking and Network Related category; Windows users are able to mount samba share using windows. But for linux user, we need to create credentials file, ...


Go Back   Usenet Forums > Networking and Network Related > Samba

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-11-2008
David Kuntadi
 
Posts: n/a
Default [Samba] Mounting Samba Share using linux login

Windows users are able to mount samba share using windows. But for
linux user, we need to create credentials file, to mount samba share
e.g:

//servername/file_store /home/user/Desktop/file_storage smbfs
credentials=/root/.smbcredentials

Is it possbile to change the credentials to something like windows
users (for example credentials=unix user) so as the mounted share
would depend on who login the linux box?

This is important as I want to let user change their own password, and
keeping .smbcredentials in user's home directory would be insecure.
But to keep the .smbcredentials at root would mean to give user admin
rights in order to change password file.

Regards,
David
--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/listinfo/samba

Reply With Quote
  #2 (permalink)  
Old 06-11-2008
Helmut Hullen
 
Posts: n/a
Default Re: [Samba] Mounting Samba Share using linux login

Hallo, David,

Du (d.kuntadi) meintest am 11.06.08:

> Windows users are able to mount samba share using windows. But for
> linux user, we need to create credentials file, to mount samba share
> e.g:


> //servername/file_store /home/user/Desktop/file_storage smbfs
> credentials=/root/.smbcredentials


> Is it possible to change the credentials to something like windows
> users (for example credentials=unix user) so as the mounted share
> would depend on who login the linux box?


You can make your own credential file as a batch file:

@echo off
rem my special batch file
set specialusername=abc
set specialpassword=topsecret

call this batch file within the logon batch file
and then use %specialusername% and %specialpassword%

Viele Gruesse!
Helmut
--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/listinfo/samba

Reply With Quote
  #3 (permalink)  
Old 06-11-2008
David Kuntadi
 
Posts: n/a
Default Re: [Samba] Mounting Samba Share using linux login

On Wed, Jun 11, 2008 at 5:55 PM, Helmut Hullen <Hullen@t-online.de> wrote:
>
> You can make your own credential file as a batch file:
>
> @echo off
> rem my special batch file
> set specialusername=abc
> set specialpassword=topsecret
>
> call this batch file within the logon batch file
> and then use %specialusername% and %specialpassword%


Hi Helmut,
Thank you very much for your reply. But could you elaborate further as
I could not understand how to do it:

1. What credentials should I put in fstab?
2. Do you mean the batch file is an executable plain text file
executed during login?

Regards,
David
--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/listinfo/samba

Reply With Quote
  #4 (permalink)  
Old 06-11-2008
Helmut Hullen
 
Posts: n/a
Default Re: [Samba] Mounting Samba Share using linux login

Hallo, David,

Du (d.kuntadi) meintest am 11.06.08:

>>
>> You can make your own credential file as a batch file:
>>
>> @echo off
>> rem my special batch file
>> set specialusername=abc
>> set specialpassword=topsecret
>>
>> call this batch file within the logon batch file
>> and then use %specialusername% and %specialpassword%


Sorry - I've written a batch file for DOS/Windows.
Linux users should use a shell script.
There are several options to run this shell:

/etc/profile.d/<specialscript.sh>
(is run when the user logs in)
Icon on the desktop
(must be clicked to run)
command in ~/.Xdefaults
(is run when an X session is started)

> 1. What credentials should I put in fstab?


None. "/etc/fstab" is not necessary for mounting.
And the special user share can't be mounted via the (global) "/etc/
fstab".

Which linux distribution is installed on the clients? Which GUI is
installed: KDE or something else?

> 2. Do you mean the batch file is an executable plain text file
> executed during login?


That is one way.

pure shell script:

#! /bin/bash
Credfile=~/.sambacred
test -s $Credfile && source $Credfile || exit 1
# and now the username and the password for the shares on the
# server are known
mount.cifs ...
#


Viele Gruesse!
Helmut
--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/listinfo/samba

Reply With Quote
  #5 (permalink)  
Old 06-11-2008
John Drescher
 
Posts: n/a
Default Re: [Samba] Mounting Samba Share using linux login

> Sorry - I've written a batch file for DOS/Windows.
> Linux users should use a shell script.
> There are several options to run this shell:
>

Although I have not done this yet (waiting for linux dfs client to
work 2.6.26 kernel), I believe pam_mount is also a good option for
this purpose:

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


John
--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/listinfo/samba

Reply With Quote
  #6 (permalink)  
Old 06-11-2008
Helmut Hullen
 
Posts: n/a
Default Re: [Samba] Mounting Samba Share using linux login

Hallo, John,

Du (drescherjm) meintest am 11.06.08:

>> Linux users should use a shell script.
>> There are several options to run this shell:


[...]

> Although I have not done this yet (waiting for linux dfs client to
> work 2.6.26 kernel), I believe pam_mount is also a good option for
> this purpose:


Only root can change these options.
If I put my script into the profile way or into .Xdefaults (p.e.), then
I can mount several foreign shares on several servers without asking my
root. Ok - "mount.cifs" must have set the "SUID" flag.

Viele Gruesse!
Helmut
--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/listinfo/samba

Reply With Quote
  #7 (permalink)  
Old 06-11-2008
Gustavo Homem
 
Posts: n/a
Default Re: [Samba] Mounting Samba Share using linux login

On Wednesday 11 June 2008 14:50, John Drescher wrote:
> > Sorry - I've written a batch file for DOS/Windows.
> > Linux users should use a shell script.
> > There are several options to run this shell:

>
> Although I have not done this yet (waiting for linux dfs client to
> work 2.6.26 kernel), I believe pam_mount is also a good option for
> this purpose:
>
> http://pam-mount.sourceforge.net/


pam_mount is the best solution as it mounts the sahre with the unix user
credentials.

Best regards
Gustavo

--
Angulo Sólido - Tecnologias de Informação
http://angulosolido.pt
--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/listinfo/samba

Reply With Quote
  #8 (permalink)  
Old 06-12-2008
David Kuntadi
 
Posts: n/a
Default Re: [Samba] Mounting Samba Share using linux login

Yes, I think pam mount is what I need. I will study it and report if
it is successfull.

Anyway, thanks also for Helmut for the idea.

Regards,
David

On Thu, Jun 12, 2008 at 3:13 AM, Gustavo Homem <gustavo@angulosolido.pt> wrote:
> On Wednesday 11 June 2008 14:50, John Drescher wrote:
>> > Sorry - I've written a batch file for DOS/Windows.
>> > Linux users should use a shell script.
>> > There are several options to run this shell:

>>
>> Although I have not done this yet (waiting for linux dfs client to
>> work 2.6.26 kernel), I believe pam_mount is also a good option for
>> this purpose:
>>
>> http://pam-mount.sourceforge.net/

>
> pam_mount is the best solution as it mounts the sahre with the unix user
> credentials.
>
> Best regards
> Gustavo
>
> --
> Angulo Sólido - Tecnologias de Informação
> http://angulosolido.pt
>

--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/listinfo/samba

Reply With Quote
  #9 (permalink)  
Old 06-12-2008
David Kuntadi
 
Posts: n/a
Default Re: [Samba] Mounting Samba Share using linux login

I have followed below guidelines which is a little bit outdated:
https://wiki.ubuntu.com/MountWindows...2b50541c417d95

It is mounted successfully by editing /etc/security/pam_mount.conf.xml
instead of /etc/security/pam_mount.conf, and follow the direction in
the /etc/security/pam_mount.conf.xml.

Now user could change samba password using usermin, and then followed
by changeing its own password to match, and the share would mount
autimatically.

Thanks again,
David
On Thu, Jun 12, 2008 at 7:54 AM, David Kuntadi <d.kuntadi@gmail.com> wrote:
> Yes, I think pam mount is what I need. I will study it and report if
> it is successfull.
>
> Anyway, thanks also for Helmut for the idea.
>
> Regards,
> David
>
> On Thu, Jun 12, 2008 at 3:13 AM, Gustavo Homem <gustavo@angulosolido.pt> wrote:
>> On Wednesday 11 June 2008 14:50, John Drescher wrote:
>>> > Sorry - I've written a batch file for DOS/Windows.
>>> > Linux users should use a shell script.
>>> > There are several options to run this shell:
>>>
>>> Although I have not done this yet (waiting for linux dfs client to
>>> work 2.6.26 kernel), I believe pam_mount is also a good option for
>>> this purpose:
>>>
>>> http://pam-mount.sourceforge.net/

>>
>> pam_mount is the best solution as it mounts the sahre with the unix user
>> credentials.
>>
>> Best regards
>> Gustavo
>>
>> --
>> Angulo Sólido - Tecnologias de Informação
>> http://angulosolido.pt
>>

>

--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/listinfo/samba

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:14 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0