[SOLVED] Resume of : Default Permissions [SOLVED]

You have a problem with Salix? Post here and we'll do what we can to help.
Post Reply
inukaze
Posts: 38
Joined: 24. Nov 2024, 18:42

[SOLVED] Resume of : Default Permissions [SOLVED]

Post by inukaze »

In resume all things i do for fix "chmod 755 -R / ; chown root:root /"

With root user :

1 - Download this file :
Petri Kaukasoina;6578400 wrote:Maybe this helps you:
https://slackware.osuosl.org/slackware64-15.0/slackware64/MANIFEST.bz2
2 - Extract the "MANIFEST" file and rename to "MANIFEST.ORIGINAL" and do the follow in a terminal :

Code: Select all

echo "$(grep -v "usr/src" MANIFEST.ORIGINAL)" > M1
echo "$(grep -v "usr/doc" M1)" > M2
echo "$(grep -v "include" M2)" > M3
echo "$(grep -v "locale" M3)" > M4
echo "$(grep -v "icons" M4)" > M5
echo "$(grep -v "pixmaps" M5)" > MANIFEST
This reduce filesize from almost 64MB to 25MB aprox.

3 - Download the script for use the edited MANIFEST File :
i put the files "restore_fileperms_from_manifest.sh" and edited "MANIFEST" on " / " in the root partition i want to fix file permissions, on my pc takes around 12 hours to finish that job

i edit the file /etc/inittab and chage the init mode from 4 to 3, and i add autologin for my user on tty6
id:3:initdefault:
c6:1235:respawn:/sbin/agetty -a inukaze 38400 tty6 linux
save the changes and exit

i remove the execution permission of ec.4 for disable automatic start the graphical env.

Code: Select all

chmod -x /etc/rc.d/rc.4

in this point i had restart the entire pc, and login like root on tty1, on the rest of tty from 2 to 6 i login with my user "inukaze"

in tty2, i try to run dosbox but appears the message
DOSBox version 0.74-3
Copyright 2002-2019 DOSBox Team, published under GNU GPL.
---
Exit to error: Can't init SDL Unable to open mouse
i try solve making the follow, in tty1 (like root)

Code: Select all

groupadd -f mouse
gpasswd -a inukaze -g mouse
i manually add the follow lines in /etc/udev/rules.d/75-mouse.rules
KERNEL=="mice" NAME="input/%k", MODE=0660, GROUP="mouse"
KERNEL=="mouse?" NAME="input/%k", MODE=0660, GROUP="mouse"
KERNEL=="event?" NAME="input/%k", MODE=0660, GROUP="mouse"
i restart again, i see the dmesg output message something like:
Error in line 1 /etc/udev/rules.d/75-mouse.rules unexpected "," in character 32
Error in line 2 /etc/udev/rules.d/75-mouse.rules unexpected "," in character 34
Error in line 3 /etc/udev/rules.d/75-mouse.rules unexpected "," in character 34
i edit again /etc/udev/rules.d/75-mouse.rules and i put the follow :
SUBSYSTEM=="input", ATTRS{name}=="ImPS/2 Generic Wheel Mouse", MODE="0666", ENV{ID_INPUT_MOUSE}="1"

#ATTRS{name} -> must be extract from output of commands :
# cat /proc/bus/input/devices #Read and determine which event is your mouse
# Notice in the output lines like :
# I: Bus=0011 Vendor=0002 Product=0005 Version=0000
# N: Name="ImPS/2 Generic Wheel Mouse" #This is the line you looking for.
# P: Phys=isa0060/serio1/input0
# S: Sysfs=/devices/platform/i8042/serio1/input/input4
# U: Uniq=
# H: Handlers=mouse0 event9
# B: PROP=1
# B: EV=7
# B: KEY=70000 0 0 0 0
# B: REL=103


#KERNEL=="mice", MODE=0660, OWNER="root", GROUP="mouse"
#KERNEL=="mouse?", MODE=0660, OWNER="root", GROUP="mouse"
#KERNEL=="event?", MODE=0660, OWNER="root", GROUP="mouse"
i restart entire pc again, i try again, dosbox ran, for few minutes
but when i put keys, the keyboard print wrong characters, and after hang up entire pc
i need a better solution for that XD, i restart, and comment out all lines by now


Again i restart the entire pc but this time

For run mouse on tty i use

Code: Select all

/usr/sbin/gpm -m /dev/input/mice -t imps2
In the tty1 i let the script "restore_fileperms_from_manifest.sh" working

Code: Select all

cd /
sh restore_fileperms_from_manifest.sh
meanwhile the script do it job, i remember some years ago i learn on Debian 8 a lot of things of working without graphical session the first things i do its check if i had the follow programs

mc -> file manager
dosbox -> msdos emulator

retroarch -> i have the flatpak, but this version requiere graphical env to work, when i compile manually i ever put does not requiere X

ppsspp -> the same case of retroarch

links (version 2) or links2 -> web browser, elinks works great with email client like gmail before, but is not working on my Slackware or salix

vlc -> the "nvlc" works for hear music, because players like cmus or moc not wanna work on my slackware and/or salix

i ran a custom compile version of dosbox like root user and that works for let me allow play some games, meanwhile the script working fixing file permissons, the thing i not remember is my custom version start graphical env without nothing and start dosbox preconfigured XD, play Supaplex after Eye Of Beholder ever is fun.

meanwhile i play on dosbox, i think i not have configured the programs to use on just "tty" mode, without Xorg / Wayland
like i do when i use Slackware(64) 14.2 things like

A - Enable Framebuffer access for video, to enable resolutions like 1024x768x16bpp on tty
B - Custom compilations of programs for use without graphical env like : retroarch, ppsspp, mplayer

C - Custom things for "mc" program to enable file associations like : image files using "zgv" image viewer, or test if the custom script for download youtube video and use mplayer in sdl mode to play it

Why never someone had create something similar to Windows 3.X, for GNU/Linux framebuffer, to looks like a graphical env but really does not its, links web browser works and look nice in framebuffer video mode.


4 - Fix sudo and su :

sudo: /var/db/sudo/lectured is world writable

Code: Select all

chmod 700 /var/db/sudo/lectured
chown root:root /var/db/sudo/lectured

sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set

Code: Select all

chmod 4755 /usr/bin/sudo
chown root:root /etc/sudoers
chown root:root /usr/bin/sudo
chown -R root:root /usr/bin/sudo
chmod -R a=rx,u+ws /usr/bin/sudo
In anothers distros is possible you need this instead :

Code: Select all

chown root:root /usr/lib/sudo/sudoers.so
chmod -R a=rx,u+ws /usr/lib/sudo/sudoers.so
chown -R root:root /usr/lib/sudo/sudoers.so
chmod 4755 /usr/lib/sudo/sudoers.so
su: The authentication service cannot retrieve authentication information

Code: Select all

packagemanager --install --reinstall shadow
locate: cannot open `/var/lib/mlocate/mlocate.db': Permission denied

Code: Select all

sudo chmod 644 /var/lib/mlocate/mlocate.db
5 - Remove, Install and/or reinstall packages : i already have packages with nvidia propetary drivers with compat32 enabled.

Code: Select all

packagemanager --remove udisks udisks2 libblockdev gvfs lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings gnome-keyring

# i delete files of service i never use :
rm -rf /etc/rc,d/rc.krb5kdc 
rm -rf /etc/rc,d/rc.kadmind 
rm -rf /etc/rc,d/rc.kpropd 
rm -rf /etc/rc,d/rc.saslauthd 
rm -rf /etc/rc,d/rc.openldap 
rm -rf /etc/rc,d/rc.anydesk 
rm -rf /etc/rc,d/rc.avahidaemon 
rm -rf /etc/rc,d/rc.avahidnsconfd 
rm -rf /etc/rc,d/rc.vboxadd-service 
rm -rf /etc/rc,d/rc.vboxautostart-service 
rm -rf /etc/rc,d/rc.vboxballoonctrl-service 
rm -rf /etc/rc,d/rc.vboxdrv 
rm -rf /etc/rc,d/rc.qemu-ga
rm -rf /etc/rc,d/rc.libvirt
rm -rf /etc/rc,d/rc.nfsd
rm -rf /etc/rc,d/rc.php-fpm
rm -rf /etc/rc,d/rc.spice-vdagent
rm -rf /etc/rc,d/rc.webmin
rm -rf /etc/rc,d/rc.wsdd2
rm -rf /etc/rc,d/rc.bluez-alsa
rm -rf /etc/rc,d/rc.bluetooth
rm -rf /etc/rc,d/rc.auditd
rm -rf /etc/rc,d/rc.auditd.conf
rm -rf /etc/rc,d/rc.AdGuardHome
rm -rf /etc/rc,d/rc.cups
rm -rf /etc/rc,d/rc.cups-browsed
rm -rf /etc/rc,d/rc.cups.orig
rm -rf /etc/rc,d/rc.mysqld
rm -rf /etc/rc,d/rc.pcmcia
rm -rf /etc/rc,d/rc.sanlock
rm -rf /etc/rc,d/rc.wdmd

# deleting residual files, for make the install of package put new fresh files.
rm -rf /var/log/lightdm
rm -rf /var/lib/lightdm
rm -rf /var/lib/lightdm-data
rm -rf /var/lib/gdm
rm -rf /var/cache/lightdm
rm -rf /usr/share/polkit-1/rules.d/42-lightdm.rules
rm -rf /etc/libblockdev
rm -rf /etc/udisks2
rm -rf /home/inukaze/.local/share/keyrings/*

packagemanager --install udisks2 \
libblockdev \
gvfs \
lightdm \
lightdm-gtk-greeter \
lightdm-gtk-greeter-settings ; ldconfig


packagemanager --install --reinstall aaa_glibc-solibs \
aaa_libraries \
aaa_terminfo \
accountsservice \
coreutils \
dbus \
desktop-file-utils \
etc \
eudev \
glibc \
glibc-i18n \
glibc-profile \
groff \
libevdev \
libnsl \
libssh \
ncurses \
network-scripts \
p11-kit \
pkgconf \
polkit \
upower \
util-linux \
wpebackend-fdo \
xdg-desktop-portal \
xdg-desktop-portal-gtk \
xdg-user-dirs \
xdg-utils \
xdgmenumaker
Now its time for fix my system when login enter in 32 Bits mode instead 64 Bits, i need to apply the multilib "Quick n' Dirty" from SlackDocs -> https://docs.slackware.com/slackware:multilib

The quick 'n' dirty instructions

Code: Select all

cd /tmp

SLACKVER=15.0
mkdir multilib
cd multilib
lftp -c "open http://slackware.nl/people/alien/multilib/ ; mirror -c -e ${SLACKVER}"
cd ${SLACKVER}
upgradepkg --reinstall --install-new *.t?z
upgradepkg --install-new slackware64-compat32/*-compat32/*.t?z ; ldconfig


Fix nvidia propetary driver :

Code: Select all

removepkg /root/nvidia-legacy390-kernel-390.157_5.15.161-x86_64-2_SBo.tgz
removepkg /root/nvidia-legacy390-driver-390.157_multilib-x86_64-7_SBo.tgz

echo -ne "blacklist nouveau\noptions nouveau modeset=0" | tee /etc/modprobe.d/BLACKLIST-nouveau.conf

installpkg nvidia-legacy390-kernel-390.157_5.15.161-x86_64-2_SBo.tgz
installpkg nvidia-legacy390-driver-390.157_multilib-x86_64-7_SBo.tgz

gpasswd -a inukaze -g video
well i add :

Code: Select all

echo 'allowed_users=anybody' | sudo tee /etc/X11/Xwrapper.config

Fix my user home files permissions :

Code: Select all

chmod 700 /home/inukaze
cd /home/inukaze
chgrp users -R * .*
chown inukaze:users -R * .*
chmod -R 755 * .*
chmod -R 700 .cache .dbus .gconf .local
chmod 644 .dmrc .ICEauthority .face .face.icon
chmod 600 .Xauthority

i restart entire system, login like root and test rc.4 works like expected

Code: Select all

sh /etc/rc.d/rc.4
The thing works like expected :D

Code: Select all

chmod +x /etc/rc.d/rc.4
edit the /etc/inittab and change init mode from 3 to 4
id:4:initdefault:
Finish the session i shutdown machine and power on again. the system was fixed.

Finally i just try skins for audacious flatpak version, with my user in a terminal, i use xfce desktop

Code: Select all

mkdir -p "$HOME/.var/app/org.atheme.audacious/data/audacious/Skins"

thunar /home/inukaze/.var/app/org.atheme.audacious/data/audacious/Skins &
i put the Skins file there, and run audacious :D for test which works

My skins with ".bmp" files not working on this version of audacious i will try convert bmp files to png.

Code: Select all

 cd "/home/inukaze/.var/app/org.atheme.audacious/data/audacious/Skins"
find . -name '*.bmp' -type f -exec bash -c 'convert "$0" "${0%.bmp}.png"' {} \;
find . -name "*.bmp" -type f -delete
That was the same, must be something in image format properties.
But not i just change to Qt Mode and the skins works xD.
Post Reply