LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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
Senior Member
 
Registered: Nov 2013
Location: Brazil
Distribution: Slackware
Posts: 1,223

Rep: Reputation: 195Reputation: 195
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: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
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
Senior Member
 
Registered: Nov 2013
Location: Brazil
Distribution: Slackware
Posts: 1,223

Original Poster
Rep: Reputation: 195Reputation: 195
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: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
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
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
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
Senior Member
 
Registered: Nov 2013
Location: Brazil
Distribution: Slackware
Posts: 1,223

Original Poster
Rep: Reputation: 195Reputation: 195
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: 393

Rep: Reputation: 81
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: 114

Rep: Reputation: 24
Anything logged in /var/log/secure when you try to su ?
 
Old 03-11-2014, 11:42 AM   #9
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
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
Senior Member
 
Registered: Nov 2013
Location: Brazil
Distribution: Slackware
Posts: 1,223

Original Poster
Rep: Reputation: 195Reputation: 195
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
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
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
Senior Member
 
Registered: Nov 2013
Location: Brazil
Distribution: Slackware
Posts: 1,223

Original Poster
Rep: Reputation: 195Reputation: 195
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
Posts: 353
Blog Entries: 4

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
Senior Member
 
Registered: Nov 2013
Location: Brazil
Distribution: Slackware
Posts: 1,223

Original Poster
Rep: Reputation: 195Reputation: 195
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: 2,557

Rep: Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761
@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



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
How do you switch to root user barrythai Ubuntu 22 08-28-2018 08:33 PM
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 switch root to another user? Xiangbuilder Linux - Newbie 1 09-15-2003 07:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration