> From: "parmenides" <[email protected]> > Date: Tue, 6 Aug 2013 02:40:05 +0800 > Subject: Re: [lfs-support] 'su' command does not take effect > > > >> > Do you have the parameter 'SU_WHEEL_ONLY' set in /etc/login.defs ? If > >> > so, to > >> > what value? > >> > >> Yes, but I think it does not matter, because I can not switch from a > >> normal user to another normal user yet. > >> In fact, I wonder why 'su' can not do what it should do - just switching > >> user without prompting privilege. > >> Switching to root has to be 'next step'. > >> > > > > > > OK. I asked what value is it set to. > > It is set to 'yes'. >
Set it to 'no' (without the quotes). Do you get any 'permission denied' or similar messages when you try to do that - e.g. when you try to open the file in an editor, or try to save your changes? Also, in /etc/login.defs , what is the 'CONSOLE' variable set to, or is it commented-out? > > > > > > Switching from one user to another, is by default not enabled, because > > otherwise, > > if you've got multiple users on the system, they could access each other's > > files > > &c; and that's not necessarily wanted. > > > IMO, every user can protect their files by setting password. Is there any way > to enable this > kind of switching? It sounds a bit curious. Actually, I think this is not > also I wanted. However, > according to some instructions from Harley Hahn's Guide to Unix and Linux, > this kind of > switching can go its way, at least in traditional Unix. > If you are logged in as user1 and you want to 'become' user2 , then normally you would do 'su - user2' (again, without the quotes). You'd normally be prompted for user2's password. (I see/guess from your note at the foot of below, that you've maybe explored this route already). Note that user2 can allow user1 access to various files/folders - without recourse to 'su ...' - by setting appropriate permissions and ownerships (and it sometimes needs a few other once-off changes to allow user2 to 'give away' files/folders). Are these the sorts of things that you want to do? Or do you really, for example, 'just' want to access some older files that happen to have a different ownership, or what? Sorry if/that am being perhaps a bit slow/dense, but I'm not understanding what exactly is it that you want to do - it seems to change, or perhaps is just I guess becoming clearer, from post to post (which is not a problem - but am just trying to understand what is wanted). > > > >> > Can you login as root directly on tty1 ? > >> > >> Does it matter? > >> > > > > > > OK. I asked, "Can you login as root directly on tty1 ?" > > No. > Hmmm. What happens when you try - what error message, if any, do you get? Did you set a root password at any point? If so, are you sure that you know it? > > > > > >> > What happens if you create the 'wheel' group and put your own non-root > >> > username > >> > into it? After that, can you 'su -' ok? If not, can you 'su' (without > >> > the '-') > >> > ok? > >> > >> If I just want to switch to a normal user, is there any help provided by > >> the 'wheel' group? > >> Do I have to create it? > >> > > > > > > I'd understood that your original request was how to 'su -' to root: > > whereas it > > now seems that it's to another non-root user. Is it the former or latter or > > both? > > > At the beginning, I don't get the idea of the difference between them. > However, I have > tried to switch to a normal user, and failed. Therefore, now I think the > 'wheel' group is > not the point. > > Leave these points as-is for now. If you want to be able to 'su' from user to user, then I'd suggest getting the 'su -' to root - and probably also root-login on tty1 - working first, and then refine from there (you can later switch off root-login on tty1 &c later, if preferred). Also, just to check, is this your own system? If so, is it local to you, and is it networked yet? rgds, akh -- -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
