* multiuser kerberised cifs via autofs needs root ticket cache
@ 2013-04-20 7:10 steve
[not found] ` <51723F74.3010807-dZ4O0aZtNmBWk0Htik3J/w@public.gmane.org>
0 siblings, 1 reply; 8+ messages in thread
From: steve @ 2013-04-20 7:10 UTC (permalink / raw)
To: linux-cifs-u79uwXL29TY76Z2rM5mHXA
Hi
one of my automount files is:
* -fstype=cifs,sec=krb5,multiuser ://doloresdc/users/&
It works fine but only if the krb5cc_0 cache is available under /tmp.
When a user logs in, he gets his own cache. With multiuser, why isn't
that good enough to be able to mount his share?
Question, if we really must have the root cache then how do I get that
on boot? I need to run this as root:
kinit -k steve2 to get the cache with my key in /etc/krb5.keytab. I
can't find a way to be able to do that on either Ubuntu 12.10 nor
openSUSE 12.3.
There must be an easy way.
Cheers,
Steve
^ permalink raw reply [flat|nested] 8+ messages in thread[parent not found: <51723F74.3010807-dZ4O0aZtNmBWk0Htik3J/w@public.gmane.org>]
* Re: multiuser kerberised cifs via autofs needs root ticket cache [not found] ` <51723F74.3010807-dZ4O0aZtNmBWk0Htik3J/w@public.gmane.org> @ 2013-04-26 14:14 ` Jeff Layton [not found] ` <20130426101410.1754c9ab-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org> 0 siblings, 1 reply; 8+ messages in thread From: Jeff Layton @ 2013-04-26 14:14 UTC (permalink / raw) To: steve; +Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA On Sat, 20 Apr 2013 09:10:44 +0200 steve <steve-dZ4O0aZtNmBWk0Htik3J/w@public.gmane.org> wrote: > Hi > one of my automount files is: > * -fstype=cifs,sec=krb5,multiuser ://doloresdc/users/& > > It works fine but only if the krb5cc_0 cache is available under /tmp. > When a user logs in, he gets his own cache. With multiuser, why isn't > that good enough to be able to mount his share? > Because you haven't specified the cruid= that should be used to mount the share and act as the root credentials for the mount. I don't think you really want "multiuser" in the above situation. It sounds like you're trying to set up each autofs-mounted cifs filesystem for a single user. In that case, you probably want to do something like: * -fstype=cifs,sec=krb5,uid=&,gid=&,cruid=& ://doloresdc/users/& ...assuming of course that the directory names under that filesystem match the usernames of your users. > Question, if we really must have the root cache then how do I get that > on boot? I need to run this as root: > kinit -k steve2 to get the cache with my key in /etc/krb5.keytab. I > can't find a way to be able to do that on either Ubuntu 12.10 nor > openSUSE 12.3. > I think you're confused as to what "multiuser" does. It allows users to access the *same* mounted filesystem with their own krb5 creds. IOW, instead of trying to use autofs like you are here, you could simply do this: mount -t cifs //doloresdc/users /cifsusers -o sec=krb5,multiuser ...assuming that you have a credcache for uid=0 or proper credentials in /etc/krb5.keytab, then it should mount and users can access everything under /cifsusers with their own credentials. -- Jeff Layton <jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org> ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <20130426101410.1754c9ab-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>]
* Re: multiuser kerberised cifs via autofs needs root ticket cache [not found] ` <20130426101410.1754c9ab-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org> @ 2013-04-26 23:22 ` steve [not found] ` <517B0C3A.80809-dZ4O0aZtNmBWk0Htik3J/w@public.gmane.org> 0 siblings, 1 reply; 8+ messages in thread From: steve @ 2013-04-26 23:22 UTC (permalink / raw) To: Jeff Layton; +Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA On 26/04/13 16:14, Jeff Layton wrote: > On Sat, 20 Apr 2013 09:10:44 +0200 > steve <steve-dZ4O0aZtNmBWk0Htik3J/w@public.gmane.org> wrote: > >> Hi >> one of my automount files is: >> * -fstype=cifs,sec=krb5,multiuser ://doloresdc/users/& >> >> It works fine but only if the krb5cc_0 cache is available under /tmp. >> When a user logs in, he gets his own cache. With multiuser, why isn't >> that good enough to be able to mount his share? >> > Because you haven't specified the cruid= that should be used to mount > the share and act as the root credentials for the mount. > > I don't think you really want "multiuser" in the above situation. It > sounds like you're trying to set up each autofs-mounted cifs filesystem > for a single user. > > In that case, you probably want to do something like: > > * -fstype=cifs,sec=krb5,uid=&,gid=&,cruid=& ://doloresdc/users/& No, it doesn't work. We'd need one & for the uid and another for the gid. We can only have one wild card I think. It's important that even though it's a singe user mount, that the files created in it are owned by the uid:gid of the user. multiuser gives us this, plus it's essential for mounts where many users have group rw to the files in the share. > > ...assuming of course that the directory names under that filesystem > match the usernames of your users. > >> Question, if we really must have the root cache then how do I get that >> on boot? I need to run this as root: >> kinit -k steve2 to get the cache with my key in /etc/krb5.keytab. I >> can't find a way to be able to do that on either Ubuntu 12.10 nor >> openSUSE 12.3. >> > I think you're confused as to what "multiuser" does. It allows users to > access the *same* mounted filesystem with their own krb5 creds. IOW, > instead of trying to use autofs like you are here, you could simply > do this: > > mount -t cifs //doloresdc/users /cifsusers -o sec=krb5,multiuser > > ...assuming that you have a credcache for uid=0 or proper credentials > in /etc/krb5.keytab, then it should mount and users can access > everything under /cifsusers with their own credentials. > Hi Yes, the permanent mount works but it's slow when the lan is busy. The automounter speeds things up quite a bit. Maybe our hardware isn't up to maintaining the permanent mount. But, in anycase, what you are saying is that I have to keep a root cache alive under /tmp to make any mount at all. That's what we're finding. How do we go about that? A cron to do kinit -k MACHINE$ every few hours for example? k5start looks ok too. Cheers, Steve ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <517B0C3A.80809-dZ4O0aZtNmBWk0Htik3J/w@public.gmane.org>]
* Re: multiuser kerberised cifs via autofs needs root ticket cache [not found] ` <517B0C3A.80809-dZ4O0aZtNmBWk0Htik3J/w@public.gmane.org> @ 2013-04-30 13:22 ` Jeff Layton [not found] ` <20130430092212.53254831-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org> 0 siblings, 1 reply; 8+ messages in thread From: Jeff Layton @ 2013-04-30 13:22 UTC (permalink / raw) To: steve; +Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA On Sat, 27 Apr 2013 01:22:34 +0200 steve <steve-dZ4O0aZtNmBWk0Htik3J/w@public.gmane.org> wrote: > On 26/04/13 16:14, Jeff Layton wrote: > > On Sat, 20 Apr 2013 09:10:44 +0200 > > steve <steve-dZ4O0aZtNmBWk0Htik3J/w@public.gmane.org> wrote: > > > >> Hi > >> one of my automount files is: > >> * -fstype=cifs,sec=krb5,multiuser ://doloresdc/users/& > >> > >> It works fine but only if the krb5cc_0 cache is available under /tmp. > >> When a user logs in, he gets his own cache. With multiuser, why isn't > >> that good enough to be able to mount his share? > >> > > Because you haven't specified the cruid= that should be used to mount > > the share and act as the root credentials for the mount. > > > > I don't think you really want "multiuser" in the above situation. It > > sounds like you're trying to set up each autofs-mounted cifs filesystem > > for a single user. > > > > In that case, you probably want to do something like: > > > > * -fstype=cifs,sec=krb5,uid=&,gid=&,cruid=& ://doloresdc/users/& > No, it doesn't work. We'd need one & for the uid and another for the > gid. We can only have one wild card I think. It's important that even > though it's a singe user mount, that the files created in it are owned > by the uid:gid of the user. multiuser gives us this, plus it's essential > for mounts where many users have group rw to the files in the share. Yeah, you'd need to figure out what should be added into there if you really think you need a separate mount per user directory. Note too that there's a catch with the above configuration -- there's nothing that prevents an entirely unrelated user from getting into the directory that's been mounted and accessing it with the mount credentials. None of that's an issue however if you use a proper multiuser mount. > > > > ...assuming of course that the directory names under that filesystem > > match the usernames of your users. > > > >> Question, if we really must have the root cache then how do I get that > >> on boot? I need to run this as root: > >> kinit -k steve2 to get the cache with my key in /etc/krb5.keytab. I > >> can't find a way to be able to do that on either Ubuntu 12.10 nor > >> openSUSE 12.3. > >> > > I think you're confused as to what "multiuser" does. It allows users to > > access the *same* mounted filesystem with their own krb5 creds. IOW, > > instead of trying to use autofs like you are here, you could simply > > do this: > > > > mount -t cifs //doloresdc/users /cifsusers -o sec=krb5,multiuser > > > > ...assuming that you have a credcache for uid=0 or proper credentials > > in /etc/krb5.keytab, then it should mount and users can access > > everything under /cifsusers with their own credentials. > > > Hi > Yes, the permanent mount works but it's slow when the lan is busy. The > automounter speeds things up quite a bit. Maybe our hardware isn't up to > maintaining the permanent mount. But, in anycase, what you are saying is > that I have to keep a root cache alive under /tmp to make any mount at > all. No, that's not what I'm saying at all. You can get the same effect by setting up credentials for root in /etc/krb5.keytab. Just pass in the correct username= mount option for the principal that you want root to be. > That's what we're finding. How do we go about that? A cron to do > kinit -k MACHINE$ every few hours for example? k5start looks ok too. > Cheers, Steve > Erm...I'm not sure how to respond to this since it doesn't make much sense. Perhaps you can outline what you mean? What exactly, is "slow" when you use a "permanent" multiuser mount? None of this should be terribly taxing on a modern computer... -- Jeff Layton <jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org> ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <20130430092212.53254831-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>]
* Re: multiuser kerberised cifs via autofs needs root ticket cache [not found] ` <20130430092212.53254831-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org> @ 2013-04-30 14:07 ` Peter Parzer [not found] ` <517FD018.40106-A1rZ2h3LdSKdPOQpRHQ53DeJuz7u0hKX@public.gmane.org> 2013-04-30 15:51 ` steve 1 sibling, 1 reply; 8+ messages in thread From: Peter Parzer @ 2013-04-30 14:07 UTC (permalink / raw) To: linux-cifs-u79uwXL29TY76Z2rM5mHXA Hi, Am 30.04.2013 15:22, schrieb Jeff Layton: > > No, that's not what I'm saying at all. You can get the same effect by > setting up credentials for root in /etc/krb5.keytab. Just pass in the > correct username= mount option for the principal that you want root to > be. > Not exactly on the topic, but I have been struggling a long time with this question. How can I setup credentials for root in /etc/krb5.keytab? I do the cifs multiuser mount in /etc/fstab at boot time. To create Kerberos tickets for root I have a network if-up hook with the command "net ads kerberos kinit -P". Is there an easier way using the keytab file? Peter ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <517FD018.40106-A1rZ2h3LdSKdPOQpRHQ53DeJuz7u0hKX@public.gmane.org>]
* Re: multiuser kerberised cifs via autofs needs root ticket cache [not found] ` <517FD018.40106-A1rZ2h3LdSKdPOQpRHQ53DeJuz7u0hKX@public.gmane.org> @ 2013-04-30 15:59 ` steve [not found] ` <517FEA68.1060602-dZ4O0aZtNmBWk0Htik3J/w@public.gmane.org> 0 siblings, 1 reply; 8+ messages in thread From: steve @ 2013-04-30 15:59 UTC (permalink / raw) To: Peter Parzer; +Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA On 30/04/13 16:07, Peter Parzer wrote: > Hi, > > Am 30.04.2013 15:22, schrieb Jeff Layton: >> >> No, that's not what I'm saying at all. You can get the same effect by >> setting up credentials for root in /etc/krb5.keytab. Just pass in the >> correct username= mount option for the principal that you want root to >> be. >> > > Not exactly on the topic, but I have been struggling a long time with > this question. How can I setup credentials for root in > /etc/krb5.keytab? I do the cifs multiuser mount in /etc/fstab at boot > time. To create Kerberos tickets for root I have a network if-up hook > with the command "net ads kerberos kinit -P". Is there an easier way > using the keytab file? > Hi Peter I'm a fellow struggler but I think I can answer this one. I just tested it. You can choose anyone to be root. You can choose any key you happen to have around in the keytab. We use the machine key because its produced when you join the domain. If you didn't secify kerberos metod = xxx before you joined, you can create the keys using net ads keytab create -UAdminUser The, on boot run: kinit -k MACHINE$ on boot and put the same command in a file under /etc/cron.hourly to keep it alive. I don't think this is the correct way, but hey it works. ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <517FEA68.1060602-dZ4O0aZtNmBWk0Htik3J/w@public.gmane.org>]
* Re: multiuser kerberised cifs via autofs needs root ticket cache [not found] ` <517FEA68.1060602-dZ4O0aZtNmBWk0Htik3J/w@public.gmane.org> @ 2013-04-30 16:08 ` Robert J. Hendelman Jr 0 siblings, 0 replies; 8+ messages in thread From: Robert J. Hendelman Jr @ 2013-04-30 16:08 UTC (permalink / raw) To: steve; +Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA, Peter Parzer On 30/04/13 16:07, Peter Parzer wrote: > Hi, > > Am 30.04.2013 15:22, schrieb Jeff Layton: >> >> No, that's not what I'm saying at all. You can get the same effect by >> setting up credentials for root in /etc/krb5.keytab. Just pass in the >> correct username= mount option for the principal that you want root to >> be. >> > > Not exactly on the topic, but I have been struggling a long time with > this question. How can I setup credentials for root in > /etc/krb5.keytab? I do the cifs multiuser mount in /etc/fstab at boot > time. To create Kerberos tickets for root I have a network if-up hook > with the command "net ads kerberos kinit -P". Is there an easier way > using the keytab file? > I was originally trying to do something similar. See https://bugs.launchpad.net/ubuntu/+source/upstart/+bug/1130781 for my Ubuntu bug report for more info. The bug report probably doesn't concern you, but I do have a working fstab line & pointers to a discussion about this earlier. When I log into my (XFCE) desktop (twice - probably a bug), I have my ticket created and accessing files in my homedir (smb mounted) works just fine. Hope this helps! Best regards, Robert ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: multiuser kerberised cifs via autofs needs root ticket cache [not found] ` <20130430092212.53254831-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org> 2013-04-30 14:07 ` Peter Parzer @ 2013-04-30 15:51 ` steve 1 sibling, 0 replies; 8+ messages in thread From: steve @ 2013-04-30 15:51 UTC (permalink / raw) To: Jeff Layton; +Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA On 30/04/13 15:22, Jeff Layton wrote: > On Sat, 27 Apr 2013 01:22:34 +0200 > steve <steve-dZ4O0aZtNmBWk0Htik3J/w@public.gmane.org> wrote: > >> On 26/04/13 16:14, Jeff Layton wrote: >>> On Sat, 20 Apr 2013 09:10:44 +0200 >>> steve <steve-dZ4O0aZtNmBWk0Htik3J/w@public.gmane.org> wrote: >>> >>>> Hi >>>> one of my automount files is: >>>> * -fstype=cifs,sec=krb5,multiuser ://doloresdc/users/& >>>> >>>> It works fine but only if the krb5cc_0 cache is available under /tmp. >>>> When a user logs in, he gets his own cache. With multiuser, why isn't >>>> that good enough to be able to mount his share? >>>> >>> Because you haven't specified the cruid= that should be used to mount >>> the share and act as the root credentials for the mount. >>> >>> I don't think you really want "multiuser" in the above situation. It >>> sounds like you're trying to set up each autofs-mounted cifs filesystem >>> for a single user. >>> >>> In that case, you probably want to do something like: >>> >>> * -fstype=cifs,sec=krb5,uid=&,gid=&,cruid=& ://doloresdc/users/& >> No, it doesn't work. We'd need one & for the uid and another for the >> gid. We can only have one wild card I think. It's important that even >> though it's a singe user mount, that the files created in it are owned >> by the uid:gid of the user. multiuser gives us this, plus it's essential >> for mounts where many users have group rw to the files in the share. > Yeah, you'd need to figure out what should be added into there if you > really think you need a separate mount per user directory. Note too > that there's a catch with the above configuration -- there's nothing > that prevents an entirely unrelated user from getting into the > directory that's been mounted and accessing it with the mount > credentials. > > None of that's an issue however if you use a proper multiuser mount. > >>> ...assuming of course that the directory names under that filesystem >>> match the usernames of your users. >>> >>>> Question, if we really must have the root cache then how do I get that >>>> on boot? I need to run this as root: >>>> kinit -k steve2 to get the cache with my key in /etc/krb5.keytab. I >>>> can't find a way to be able to do that on either Ubuntu 12.10 nor >>>> openSUSE 12.3. >>>> >>> I think you're confused as to what "multiuser" does. It allows users to >>> access the *same* mounted filesystem with their own krb5 creds. IOW, >>> instead of trying to use autofs like you are here, you could simply >>> do this: >>> >>> mount -t cifs //doloresdc/users /cifsusers -o sec=krb5,multiuser >>> >>> ...assuming that you have a credcache for uid=0 or proper credentials >>> in /etc/krb5.keytab, then it should mount and users can access >>> everything under /cifsusers with their own credentials. >>> >> Hi >> Yes, the permanent mount works but it's slow when the lan is busy. The >> automounter speeds things up quite a bit. Maybe our hardware isn't up to >> maintaining the permanent mount. But, in anycase, what you are saying is >> that I have to keep a root cache alive under /tmp to make any mount at >> all. > No, that's not what I'm saying at all. You can get the same effect by > setting up credentials for root in /etc/krb5.keytab. Just pass in the > correct username= mount option for the principal that you want root to > be. OK. Based on that and as all the clients have the MACHINE$ principal in their keytab, could I say, 'I want root to be MACHINE$'? and put username=MACHINE$ as a mount option? But then, wouldn't any file created in the mounted share be owned by MACHINE$. But wait, the MACHINE$ object doesn't have rfc2307 and even if it did it still gives me files owned by MACHINE$ and not e.g. steve2 who wants files in his home directory to be owned by steve2. >> That's what we're finding. How do we go about that? A cron to do >> kinit -k MACHINE$ every few hours for example? k5start looks ok too. >> Cheers, Steve >> > Erm...I'm not sure how to respond to this since it doesn't make much > sense. Perhaps you can outline what you mean? What exactly, is "slow" > when you use a "permanent" multiuser mount? None of this should be > terribly taxing on a modern computer... > What I've done is put: #!/bin/bash kinit -k MACHINE$ in a file, chmod +x'd it and stuck it in /etc/cron.hourly It works. I can leave the client on for 3 days and users will always have their home directory mounted just fine. Without the cron, cifs fails after 10 hours or so. On the speed point, this setup is at a school. You notice it when e.g. all the kids grab the same big jpg all at the same time at the start of a lesson. Remember, schools use 10 year old computers. autofs tightens things up. I don't know why. We can't afford a dedicated file server. It's a samba4 box which has to be DC and file server for 10 xp and 18 openSUSE clients. Thanks for your patience ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2013-04-30 16:08 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-20 7:10 multiuser kerberised cifs via autofs needs root ticket cache steve
[not found] ` <51723F74.3010807-dZ4O0aZtNmBWk0Htik3J/w@public.gmane.org>
2013-04-26 14:14 ` Jeff Layton
[not found] ` <20130426101410.1754c9ab-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2013-04-26 23:22 ` steve
[not found] ` <517B0C3A.80809-dZ4O0aZtNmBWk0Htik3J/w@public.gmane.org>
2013-04-30 13:22 ` Jeff Layton
[not found] ` <20130430092212.53254831-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2013-04-30 14:07 ` Peter Parzer
[not found] ` <517FD018.40106-A1rZ2h3LdSKdPOQpRHQ53DeJuz7u0hKX@public.gmane.org>
2013-04-30 15:59 ` steve
[not found] ` <517FEA68.1060602-dZ4O0aZtNmBWk0Htik3J/w@public.gmane.org>
2013-04-30 16:08 ` Robert J. Hendelman Jr
2013-04-30 15:51 ` steve
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.