Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
|
03-11-2014, 10:30 AM
|
#1
|
Senior Member
Registered: Nov 2013
Location: Brazil
Distribution: Slackware
Posts: 1,223
Rep:
|
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?
|
|
|
03-11-2014, 10:58 AM
|
#2
|
Slackware Contributor
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559
|
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
|
|
|
03-11-2014, 11:09 AM
|
#3
|
Senior Member
Registered: Nov 2013
Location: Brazil
Distribution: Slackware
Posts: 1,223
Original Poster
Rep:
|
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.
|
|
|
03-11-2014, 12:00 PM
|
#4
|
Slackware Contributor
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559
|
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
|
|
|
03-11-2014, 12:21 PM
|
#6
|
Senior Member
Registered: Nov 2013
Location: Brazil
Distribution: Slackware
Posts: 1,223
Original Poster
Rep:
|
Quote:
Originally Posted by Alien Bob
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
|
|
|
03-11-2014, 12:23 PM
|
#7
|
Member
Registered: May 2008
Location: Republic of Texas
Posts: 393
Rep:
|
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 12:27 PM.
|
|
|
03-11-2014, 12:28 PM
|
#8
|
Member
Registered: Aug 2004
Location: MD
Distribution: Slackware
Posts: 114
Rep:
|
Anything logged in /var/log/secure when you try to su ?
|
|
|
03-11-2014, 12:42 PM
|
#9
|
LQ Veteran
Registered: May 2008
Posts: 7,102
|
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.
|
|
|
03-11-2014, 01:05 PM
|
#10
|
Senior Member
Registered: Nov 2013
Location: Brazil
Distribution: Slackware
Posts: 1,223
Original Poster
Rep:
|
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.
|
|
|
03-11-2014, 01:08 PM
|
#11
|
LQ Veteran
Registered: May 2008
Posts: 7,102
|
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.
|
|
|
03-11-2014, 01:13 PM
|
#12
|
Senior Member
Registered: Nov 2013
Location: Brazil
Distribution: Slackware
Posts: 1,223
Original Poster
Rep:
|
Hmm, I didn't know slackware-current was running llvm 3.4. Thanks for the tip.
|
|
|
03-12-2014, 12:36 AM
|
#13
|
Member
Registered: Aug 2010
Posts: 353
Rep:
|
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.
|
03-12-2014, 08:39 AM
|
#14
|
Senior Member
Registered: Nov 2013
Location: Brazil
Distribution: Slackware
Posts: 1,223
Original Poster
Rep:
|
Will setup fakeroot when I get home, can you use sbopkg with fakeroot?
|
|
|
03-12-2014, 09:13 AM
|
#15
|
Senior Member
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,559
|
@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.
|
All times are GMT -5. The time now is 09:35 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|