You are not logged in.
i normally am able to ssh into my system with a user, then su into root. something got messed on /etc i suspect, to where now i cant anymore. i get
$ su
Password:
su: Authentication failurethis only happens via ssh, i can su just fine within the console of the machine in shelling into just fine.
somehow when i ran a chown command prior to this problem, i left out a simple little dot "." thereby accidentally running on root, by the time i caught it, had ripped through /etc and the directories that fall before that alplabetically on root.
does anyone know what file i can look at, or some permissions i might need to check to get this resolved?
Last edited by wolfdogg (2013-10-23 00:44:22)
Offline
well i got a clue when i ran
$ sudo
sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit setand it looks like the sticky bit isnt set for both su and sudo.
is there an easy way to list files that need the sticky bit on another arch system (which im on now), and run an exec command to set them back on those listed files?
Edit: ok sorry to bother, it was a lame mistake, but i got it to work. i had to add the set guid bit to user root for su, which i was wrongly calling sticky bit.
# chmod u+s susince the symlink was first alphabetically it was bin that got hit, i did a bit of research and it looks like all the files are and should be root:root, so im thinking its only this set guid bit that got lost. I know i have to reset these carefully. can somebody push me in the right direction to where i can gather a list, either from a resource, or run a command on my other arch box to put this list to a text file, then execute a command to add this setguid bit on those files in the list on the affected machine?
im thinking something like
find /bin/* -perm +4000 > bin_setguid.files
#yields
./rsh
./rlogin
./expiry
./passwd
./rcp
./gpasswd
./umount
./su
./chfn
./fusermount
./mount.cifs
./unix_chkpwd
./chage
./Xorg
./pkexec
./chsh
./screen-4.0.3
./newgrp
./crontab
./sudo
./sg
./ksu
./mount
../bin/rsh
../bin/rlogin
../bin/expiry
../bin/passwd
../bin/rcp
../bin/gpasswd
../bin/umount
../bin/su
../bin/chfn
../bin/fusermount
../bin/mount.cifs
../bin/unix_chkpwd
../bin/chage
../bin/Xorg
../bin/pkexec
../bin/chsh
../bin/screen-4.0.3
../bin/newgrp
../bin/crontab
../bin/sudo
../bin/sg
../bin/ksu
../bin/mount
../lib/ssh/ssh-keysign
../lib/polkit-1/polkit-agent-helper-1
../lib/dbus-1.0/dbus-daemon-launch-helper then copy that file over to the other machine and use it there somehow to run a command on to bulk set the files in the list to add the bit back.
would this work? what kind of command should i be looking towards to read the above list, and apply the following comand to each
chmod u+s $VARor will a command be able to handle this, or maybe i need to use a shell script.
Last edited by wolfdogg (2013-10-18 08:43:12)
Offline
Offline
Perhaps you should post the command you ran by mistake as that might help people advise you on how best to undo it! Knowing exactly what you did is sort of important.
Not everything in /usr/bin on my machine is owned by root:root although they are all owned by the root user.
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline
#/home/wolfdogg chown wolfdogg:users /* -r
^C an idiotic mistake.
was supposed to be
#/home/wolfdogg chown wolfdogg:users ./* -r
^Ci think that about says it. i caught it and stopped it as it was plowing through /etc. It also ripped through the symlink bin -> usr/bin/ which caused the problem, since bin comes before /etc. of course it also ran through /boot and /dev before getting half way through /etc. /boot and /dev are all root anyway, and i didnt see any problems there.
Normally i would never run it like that but for some reason i didnt want to rechown the parent directory so did it from inside, causing the potential for the mistake. i.e. # / chown wolfdogg:users /home/wolfdogg -r would have been much safer obviously.
i had posted the command in the first post but i accidentally removed it when i edited the post.
, i already reset the owners for "nobody", which is all i see other than root, so that part is taken care of already. But what it caused is it lost all the set guid bit's on change of owner ship which is the problem. So simply setting them back to root:root isn't enough. i have to set the guid bit back as well. here's the list of files i need to run this command on , as taken from another arch installation. It should cover most of them.
find / -perm +4000 > bin_setguid.files
./rsh
./rlogin
./expiry
./passwd
./rcp
./gpasswd
./umount
./su
./chfn
./fusermount
./mount.cifs
./unix_chkpwd
./chage
./Xorg
./pkexec
./chsh
./screen-4.0.3
./newgrp
./crontab
./sudo
./sg
./ksu
./mount
../bin/rsh
../bin/rlogin
../bin/expiry
../bin/passwd
../bin/rcp
../bin/gpasswd
../bin/umount
../bin/su
../bin/chfn
../bin/fusermount
../bin/mount.cifs
../bin/unix_chkpwd
../bin/chage
../bin/Xorg
../bin/pkexec
../bin/chsh
../bin/screen-4.0.3
../bin/newgrp
../bin/crontab
../bin/sudo
../bin/sg
../bin/ksu
../bin/mount
../lib/ssh/ssh-keysign
../lib/polkit-1/polkit-agent-helper-1
../lib/dbus-1.0/dbus-daemon-launch-helperexcept that command was ran on an older installation so i dont have al those files in this new system. i dont see that as a problem however, if it doenst see them it wont set them. But what im looking for is the proper way to run an exec command on top of a find command to set the 'set guid' back on the listed files, by recursively reading the list and targeting them only.
right now when this is ran in /bin i get this
[root@falcon bin]# find ./* -perm +4000
./fusermount
./su
./sudo
./suexec
./unix_chkpwdonly 5 files. i suspect on a new default installation this list should be a bit longer.
Last edited by wolfdogg (2013-10-23 05:23:21)
Offline
$ l /usr/bin/ | grep -v "root root"
total 512M
-rwxr-sr-x 1 root locate 39K Med 22 2012 locate*
-rwxr-sr-x 1 root tty 23K Gor 31 14:15 wall*
-rwxr-sr-x 1 root tty 15K Gor 31 14:15 write*
$ find /usr/bin/ -perm -4000
/usr/bin/crontab
/usr/bin/sg
/usr/bin/incrontab
/usr/bin/chage
/usr/bin/Xorg
/usr/bin/gpasswd
/usr/bin/pkexec
/usr/bin/rlogin
/usr/bin/rsh
/usr/bin/fusermount
/usr/bin/chfn
/usr/bin/rcp
/usr/bin/expiry
/usr/bin/su
/usr/bin/chsh
/usr/bin/sudo
/usr/bin/screen-4.0.3
/usr/bin/mount
/usr/bin/umount
/usr/bin/ksu
/usr/bin/mount.cifs
/usr/bin/passwd
/usr/bin/newgrp
/usr/bin/mount.nfs
/usr/bin/unix_chkpwd
/usr/bin/udevil
$ find /usr/bin/ -perm -2000
/usr/bin/locate
/usr/bin/write
/usr/bin/wall
/usr/bin/mount.cifs
/usr/bin/unix_chkpwdTry
$ echo chmod u+s $(cat setuser.txt)
$ echo chmod g+s $(cat getgroup.txt)If the results are satisfactory, remove the echo and rerun with root privileges.
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline