LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 03-11-2014, 09:30 AM   #1
moisespedro
Member
 
Registered: Nov 2013
Distribution: Slackware
Posts: 749

Rep: Reputation: 77
Can't switch to root as user


On any tty I can log as root just fine. But if I am logged as user and I try "su" or "su -" I can't do it. It gives me an "authentication error". What happened?
 
Old 03-11-2014, 09:58 AM   #2
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 5,191

Rep: Reputation: Disabled
Only you can tell us what happened. This should work, unless you configured the /etc/suauth file. Or perhaps you messed with the keyboard definitions and are typing something else than you think?

Eric
 
Old 03-11-2014, 10:09 AM   #3
moisespedro
Member
 
Registered: Nov 2013
Distribution: Slackware
Posts: 749

Original Poster
Rep: Reputation: 77
I can't tell because I didn't do anything. I was using the llvm.SlackBuild and on the chown part I received a bunch of "not authorized operation". I found it weird because I was running it as root (logged as root on an urxvt terminal, X session was being run by an user). I don't see how that could be related to this matter but that is what I was doing. And I didn't mess with the keyboard because I can log as root just fine, if it is the first login. I just can't switch to root from an existing user.
 
Old 03-11-2014, 11:00 AM   #4
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 5,191

Rep: Reputation: Disabled
I don't understand. You are root, and then you run llvm.SlackBuild ? Then there is no involvement of your normal user account, and "su" is not called from the SlackBuild at all.

How about your filesystem, what type is it? Is this a FAT filesystem, or a readonly filesystem where you are running these chown commands? My guess is that this has nothing to do with root or su but with the storage filesystem.

Eric
 
Old 03-11-2014, 11:02 AM   #5
GazL
Senior Member
 
Registered: May 2008
Posts: 3,324

Rep: Reputation: 881Reputation: 881Reputation: 881Reputation: 881Reputation: 881Reputation: 881Reputation: 881
Sounded familar:
http://www.linuxquestions.org/questi...or-4175432061/

Was it an old version of the slackbuild?
 
Old 03-11-2014, 11:21 AM   #6
moisespedro
Member
 
Registered: Nov 2013
Distribution: Slackware
Posts: 749

Original Poster
Rep: Reputation: 77
Quote:
Originally Posted by Alien Bob View Post
I don't understand. You are root, and then you run llvm.SlackBuild ? Then there is no involvement of your normal user account, and "su" is not called from the SlackBuild at all.

How about your filesystem, what type is it? Is this a FAT filesystem, or a readonly filesystem where you are running these chown commands? My guess is that this has nothing to do with root or su but with the storage filesystem.

Eric
ext4, the errors are probaly unrelated to what the slackbuild did but they appeared the first time while I was running it.

@GazL I retrieved the one on the slackware 14.1 source tree, it was made for llvm 3.3 and I was trying to build llvm 3.4
 
Old 03-11-2014, 11:23 AM   #7
perbh
Member
 
Registered: May 2008
Location: Republic of Texas
Posts: 226

Rep: Reputation: 37
I have something similar happening every so often - and I have never been able to figure out why :-(
Scenario:
1) file-server running slackware-13.37 (nfs-export)
2) client running slackware-14.1 (though I also experienced the same problem with 14.0)
3) seeing I sudo to root fairly often, I make doubly sure that all the exported directories and files are 'rw'-accessible to everyone.

My problem comes when I 'cd' deep into the hierarchy (as 'root'), do a 'ls' to make sure the file I want is there and then 'vi' on the file.
I get an error-message saying "No path to file" The same happens if I try to do a 'chmod' on it, even though its allready marked as 'rw'. However, I _can_ 'cat' the file!

The solution: Step up one level and do a 'chmod -R' on the directory, then go back again and everything is allright!

This doesn't happen all the time, just occasionally (like maybe once/month) and seeing I know what to do, I decided just to live with it.

@OP:
Could this be something similar to what you have experienced?

ps. I forgot to mention - I can make _new_ files in the directory, just not allowed to access existing ones.

Last edited by perbh; 03-11-2014 at 11:27 AM.
 
Old 03-11-2014, 11:28 AM   #8
NeoMetal
Member
 
Registered: Aug 2004
Location: MD
Distribution: Slackware
Posts: 101

Rep: Reputation: 17
Anything logged in /var/log/secure when you try to su ?
 
Old 03-11-2014, 11:42 AM   #9
GazL
Senior Member
 
Registered: May 2008
Posts: 3,324

Rep: Reputation: 881Reputation: 881Reputation: 881Reputation: 881Reputation: 881Reputation: 881Reputation: 881
Unfortunately, the slackbuild in 14.1 still has potential for damage:

Code:
cd $TMP
rm -rf $PKGNAM-${VERSION}.src
tar xvf $CWD/$PKGNAM-$VERSION.src.tar.xz || exit 1

cd $PKGNAM-${VERSION}.src/tools
  tar xvf $CWD/cfe-$VERSION.src.tar.xz || exit 1
  mv cfe-${VERSION}.src clang || exit 1
cd ../

chown -R root:root .
chmod -R u+w,go+r-w,a-s .
If that cd doesn't work, the subsequent 'cd ../' will take you from /tmp to '/' and then you're heading for a world of hurt when the chown/chmod gets run. I suspect that is what happened to you.
 
Old 03-11-2014, 12:05 PM   #10
moisespedro
Member
 
Registered: Nov 2013
Distribution: Slackware
Posts: 749

Original Poster
Rep: Reputation: 77
Well, I had a clonezilla backup so it is all fine now. And yes I guess that was what happened. Next time, I gonna check all the directories before trying to build it.
 
Old 03-11-2014, 12:08 PM   #11
GazL
Senior Member
 
Registered: May 2008
Posts: 3,324

Rep: Reputation: 881Reputation: 881Reputation: 881Reputation: 881Reputation: 881Reputation: 881Reputation: 881
FWIW, I borrowed the llvm 3.4 build tree from slackware-current and built it on 14.1. If you want the update, then that is probably the best way to go.

Glad you had a backup.
 
Old 03-11-2014, 12:13 PM   #12
moisespedro
Member
 
Registered: Nov 2013
Distribution: Slackware
Posts: 749

Original Poster
Rep: Reputation: 77
Hmm, I didn't know slackware-current was running llvm 3.4. Thanks for the tip.
 
Old 03-11-2014, 11:36 PM   #13
MadMaverick9
Member
 
Registered: Aug 2010
Location: Here
Distribution: Slackware 14.0
Posts: 125

Rep: Reputation: Disabled
Hope you learned your lesson from all this.

You never run a build script as root. Never.

https://docs.fedoraproject.org/en-US...s02s02s02.html
The same goes for Slackware packages.

You should use fakeroot.

Here are some good explanations why:
https://www.linuxquestions.org/quest...3/#post4970455
https://www.linuxquestions.org/quest...3/#post4874270

http://www.tldp.org/LDP/lame/LAME/li...t-account.html
You create your Slackware package as a regular user using fakeroot and you install them as root.

The only time this rule failed on me, was when I tried to build Gtk+ 2.24.10 on 13.37. What you do then, is create a VM where it doesn't matter if things get messed up, because you can just delete the VM and re-create it.

PS: If you create Slackware packages as a regular user without fakeroot, then your "/usr/bin/" directory will suddenly be owned by you, instead of root, after installing the package. If you're lucky, your Slackbuild will simply fail because you can't do a "chown root" as a regular user. If you're unlucky, your permissions and ownership on system directories will get messed up after installing your package.
 
2 members found this post helpful.
Old 03-12-2014, 07:39 AM   #14
moisespedro
Member
 
Registered: Nov 2013
Distribution: Slackware
Posts: 749

Original Poster
Rep: Reputation: 77
Will setup fakeroot when I get home, can you use sbopkg with fakeroot?
 
Old 03-12-2014, 08:13 AM   #15
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 1,806

Rep: Reputation: 810Reputation: 810Reputation: 810Reputation: 810Reputation: 810Reputation: 810Reputation: 810
@MadMaverick9 actually I said, I don't tend to use root for these things and that you don't need to. The risk in using root for SBo is pretty low given the scripts are reviewed, so in that case its fine using root and in fact this is the only supported (by the SBo guys) method.

You can use fakeroot but it requires setting up things like your $PATH to include /sbin, /usr/sbin, etc. and in the case of sbopkg changing the ownership of various files in /var. To put it another way it is more effort to setup fakeroot and root is probably good enough for most people when using SBo SlackBuilds.

Don't get me wrong I am a fan of fakeroot but I was not trying to claim it was the be all and end all.
 
2 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
switch to root user jlpeng Linux - Newbie 7 10-07-2013 02:13 AM
switch to root user bdavide Linux - Newbie 14 05-20-2008 07:44 PM
How do I switch to root user binarybob0001 Programming 4 11-26-2007 03:26 AM
How do you switch to root user barrythai Ubuntu 19 04-13-2007 11:55 AM
How switch root to another user? Xiangbuilder Linux - Newbie 1 09-15-2003 07:19 AM


All times are GMT -5. The time now is 03:03 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration