OT: Sometimes …

Forum Forums General Software OT: Sometimes …

This topic contains 28 replies, has 4 voices, and was last updated by rej Aug 29-11:54 am.

Viewing 15 posts - 1 through 15 (of 29 total)
  • Author
    Posts
  • #26087
    Avatar
    Anonymous

    @ rej #26045 & @ BoobC #26066

    (in “antiX-19-b3-full and base versions (64 and 32 bit) available”)

    That’s perfectly normal in Linux world.

    I have installed antiX Beta 3 and am finding the same issues that I reported in Beta 2 IceWM …

    That’s not exact some antiX issue, that’s “wider Linux weirdness” …

    One small example — 1st & 2nd Screenshot.

    Once, somewhere, I’ve created a file “google-measure-test.txt”. Since I’m using different OS (and different file systems!), different applications to create and read files … I’ve noClue when or where the file was originally created, but it somehow ended up on my Mint 19.2 (ext4). If I try to open it, on double click it’ll ask me “show or execute”. For this “experiment”, I’ve copied the file to USB (fat32) first and then copied it onto my KDE neon 5.16 User Edition (ext4). I double clicked the exact same file again and it simply opened, without asking any further questions.

    Please compare the Terminal outputs carefully … the file “MSI-A88XM-GAMING.txt” was originally created on Mint and the “google-measure-test.txt” “landed somehow” on the disk.

    Original file created on Mint has the permissions 644, “mystery file” 777, but after copying it to USB and further to Neon, it again shows 644, as it would have been created on Neon.

    Another quirk, folder with JWM themes on antiX … all the rest of the screenshots.

    As you can clearly see, one exact same type of file has different “MIME-type” symbols. It doesn’t matter which file manager.

    Dolphin, ROX, SpaceFM … they all show two different file types.

    Screenshots 9 & 10 show you the cause — remove the HTML-comment line on top, and HTML file will become “normal” file.

    Windows 10 and XP don’t care for the difference.

    Sometimes modern Linux tries to be “smarter” than it’s users …

    #26119
    Member
    Avatar
    BobC

    My comments are aimed at rej, but I don’t know if he is reading this thread….

    I have had problems with permissions before, usually when moving from flashdrive from windows or other linux distros. The best way I have found is to put all of them into a folder and change the owner and permissions on all the files in the folder at once when importing them. I think it would be best to look at them via an ls -la command or mc from a terminal rather than in gui view so its obvious all the exact settings. Noclue’s graphical screen prints show why I say that. They are very hard to follow via gui, but the terminal screens show the exact situation.

    Another time I had problems was when I did a recursive change of permissions in my home folder and it changed the linked files wherever they were. The mess was so bad that I had to reinstall.

    Another time I tried to reuse the /home directory and that made a big mess. Since then I always save what i want to keep somewhere else, format before install, and then copy the saved stuff in.

    I would suggest going into the folder and selecting all the ones with wrong permissions and fixing them. So far as I know, the beta hasn’t been causing permission problems on files. Spacefm works well for that if the columns are selected to view.

    As for wallpaper files, there is a lot of code that will trip over spaces or special characters in filenames, so those should be avoided. Someplace I wrote a routine to rename file stripping out the unusual stuff. Maybe that would be appropriate. You can probably find a 1 line script to do taht someplace on the net.

    added same view from spacefm

    • This reply was modified 2 months ago by BobC.
    #26141
    Member
    Avatar
    rej

    NoClue and BobC-

    Thank you – this post is a great effort with a lot of thought, and I appreciate both of you putting in the time to address this – have copied it to a file and am trying to sort through it on a laptop that has a large screen for more detail in the pics.

    The wallpaper issue ended up being resolved by taking spaces out of the file name, as anticapitalista had suggested. Grub background requires this also, but this had not occurred to me because it has never been necessary in antiX before.

    As far as the executable files, this has also never happened previously and I have installed it so many times on various computers, that there are 3 hard drives [one 1TB and two 320gb] storing the snapshots.

    I am trying to understand this and am not very experienced in this arena. There are no imported files from other operating systems – only MX and antiX. The only operating systems installed on my computers are Windows [solely for resolving hardware issues], Debian 10 Buster [for reference] and multiple installs of antiX and MX [both for daily use].

    There are way too many files to sort out and change individually. If I choose to continue to use 19 and there are no major problems with functionality, I will just not use Rox-filer, and instead work with SpaceFM or Thunar. They are more than adequate alternatives. Although SpaceFM displays the files as executable, it opens them as regular text files. Also, once Xfce is set up, it runs quite well and recognizes files as it should. It is just surprising that the Rox issue has turned up after years, never before, and on several (5 or 6) installs of Beta 19 on various model devices.

    I apologize for the recent posting blunders. My focus has been all over the place.

    I am also, because of my inexperience on this level, perhaps not a good candidate for testing beta releases. It was just in response to Dolphin Oracle’s request for users to do so, on “Big Daddy Linux Live”.

    I will continue to attempt to make sense of this, and experiment.

    Thanks again – you have gone above and beyond.

    #26153
    Avatar
    Anonymous

    The wallpaper issue … Grub background … taking spaces out of the file name …

    NEVER use empty spaces and special characters in names. Use only “clean” letters (NO ä, ö, ü, à, é, è …) and “-” or “_”.

    As far as the executable files, this has also never happened previously and I have installed it so many times on various computers

    There’s always “the first time”.

    To fix it in a matter of seconds, open the Terminal and execute:

    CLOSE ALL RUNNING PROGRAMS EXCEPT THE TERMINAL!

    ($USER == your username / home directory)

    sudo chown -R $USER:$USER /home/$USER

    and

    sudo chmod -R 755 /home/$USER

    #26171
    Member
    Avatar
    BobC

    Noclue,

    I agree on the file naming.

    On the terminal commands, If there are any link files in your home directory, will that change the files they link back to?

    #26172
    Forum Admin
    Dave
    Dave

    Global 755 permission change in the home folder has a high potential of causing an issue and will make a text document show as an executable because that is what you are specifying. (which is one of the problems IIUC) The text documents / configs should be 644. In fact the likelihood of doing a global 644 in the home directory and having a problem with an executable is likely lower than the number of quirky issues when doing a global 755 of the home directory.

    Edit: also if you do want to setup permissions in the way it it is better to split the chmod command in two different commands as to specify one permission set for folders and another for files. And still the area “special” files that may require “special” attention.

    • This reply was modified 1 month, 4 weeks ago by Dave.

    Computers are like air conditioners. They work fine until you start opening Windows. ~Author Unknown

    #26174
    Avatar
    Anonymous

    @ Dave

    In Ubuntu and many others — 755 is actual default for home directory (700 in “business grade”, multi-user OS).

    Why my Home directory has permissions set to 755 by default

    The user files are mostly 644 though.

    Global 755 permission change in the home folder has a high potential of causing an issue …

    Yes, in some cases, but I wouldn’t expect rey to have a file named 0_temp.sh, which has “delete antiX from HDD” script inside and which he would blindly double click.

    However, those couple of things that MIGHT get borked are probably easier to fix (if they happen at all), than change all the permissions one by one.

    And if … sh*t happens, you pay for every school. 😉

    Could you eventually write a script that would change all files permissions in user directories only to 644, but set folders to 755?

    #26177
    Forum Admin
    Dave
    Dave

    Could you eventually write a script that would change all files permissions in user directories only to 644, but set folders to 755?

    No need. Can be done many ways… one example

    find /home/MyUser -type d -exec chmod 755 {} \;
    find /home/MyUser -type f -exec chmod 644 {} \;

    Computers are like air conditioners. They work fine until you start opening Windows. ~Author Unknown

    #26178
    Avatar
    Anonymous

    Thanks Dave!

    I have ZERO scripting skills. 🙁

    My only other idea, without searching the i-net, would be to do it folder by folder …

    Once with 644 with -R and then again, 755 for user folders only (without -R).

    Something like:
    sudo chmod -R 644 /home/$USER/Documents
    sudo chmod 755 /home/$USER/Documents

    Thanks!

    #26191
    Member
    Avatar
    rej

    noClue, BobC, and Dave-

    Thanks for the input.
    Made snapshot and bootable USB to test:

    sudo chown -R $rj:$rj /home/$rj

    and

    sudo chmod -R 755 /home/$rj
    —————
    Did not change anything
    —————
    sudo chown -R $rj:$rj /home/$rj

    and

    sudo chmod -R 644 /home/$rj
    ————–

    Deleted home folder and nothing worked – no menu or logout – powered off.

    Re-installed 3 times and tried the 644 version 3 times. Same result. Maybe I did something wrong.

    #26192
    Member
    Avatar
    BobC

    Yes, that was why I asked about the linked files, because the same thing happened to me and I ended up needing to reinstall.

    That was why I suggest moving the files you wanted to affect to a separate folder, changing them, and then moving them back. My suggestion is not to touch anything but the files you actually intend to change.

    If you open up 2 panes in spacefm with all columns visible on both you can see what you are doing and do them all at once.

    #26206
    Member
    Avatar
    rej

    NoClue and BobC-

    Are you guys testing with the Base or Full version?

    #26208
    Member
    Avatar
    BobC

    I am running the full x64 version live since 19a2 when my HP died and I had to switch from it. Risky, but thus far no major problems caused by antiX.

    This might help for your renaming… It is set to just echo the command it would run, but if you remove the echo, it would then actually run it. I didn’t test it that much, for example what happens if the file with the name you are going to rename it to already exists, but that would be something to play with… Be safe, test with a copy of a folder with stuff you don’t care about and don’t blame me if it causes trouble 🙂

    sorry, line of code gets messed up if entered here

    example output…

    mv chgsrsync chgsrsync
    mv desktop session ~@#., wallpaper desktopsession~@#.wallpaper
    mv desktop-session-wallpaper desktop-session-wallpaper
    mv search-bar-icon search-bar-icon
    mv streamlight-gui-launcher.sh streamlight-gui-launcher.sh
    mv test.sh~ test.sh~
    mv testfile testfile
    mv test~@ test~@
    mv test~@# test~@#
    mv test~@#_-.,.txt test~@#_-..txt

    • This reply was modified 1 month, 4 weeks ago by BobC.
    Attachments:
    1. fixfilenames.zip
    #26214
    Avatar
    Anonymous

    @ rej

    First, please take my apology for the troubles it caused.
    I assumed that you have the basic Linux rights management understanding, but I was wrong.

    Are you guys testing with the Base or Full version?

    Makes no difference on that matter.

    sudo chown -R $rj:$rj /home/$rj

    and

    sudo chmod -R 644 /home/$rj
    ————–

    Deleted home folder and nothing worked – no menu or logout – powered off.

    Re-installed 3 times and tried the 644 version 3 times. Same result. Maybe I did something wrong.

    You did it very much wrong.

    @ BobC

    … the same thing happened to me and I ended up needing to reinstall.

    No need to reinstall even if, reinstalling is a better chice at that point, since the basic problem stays there.

    Rej, it’s so:

    In /home is your own main user folder, containing all other user folders and named as your user name.

    I suppose it’s called “rj” in your case … /home/rj

    Now, the rights are written either as 3 numbers or 3×3 letters.

    644 == rw–r– –r– – (3-bit word, a combination of 4 2 1)

    If you see a “d” at the beginning, it stands for “directory”.

    Each of those numbers (or each group of letter groups) stand for one user: user – group – others

    And there is a “$” sign which stands for the variable.

    “-R” stands for “recursive”.

    Last, normal files (some PDF, TXT, JPG, PNG …) in Linux should have the permission “6” (r + w — read + write) for yourself and the directories should be “7” (rwx) since you need to be able to execute them (enter their contents).

    What went wrong in your case is:

    There’s no user $ry.

    It’s either user “$USER”, a variable that stands for the user which is executing the command, or it’s “rj”.

    Will say, if a user “rj” is executing the command “chown $USER:$USER”, it’ll actually automatically do “chown rj:rj”.

    After executing:

    sudo chown -R $rj:$rj /home/$rj and sudo chmod -R 644 /home/$rj

    … you made nonexistent user “$rj” take the ownership of all files and …

    … you took him permission to access its own home folder including all the files inside.

    Actually, at that point, you’re not even able to shut down your system anymore and if you ever reach the login screen again and try to log in, you’ll get only:

    See 2nd screenshot.

    If you had been executing:

    sudo chown -R rj:rj /home/rj (“rj” would become the owner of /home/rj folder and all other files and folders inside)

    sudo chmod -R 644 /home/rj (“rj” would lose the permission to enter /home/rj folder and all files and folders inside would be set to read + write permissions)

    sudo chmod 755 /home/rj (“rj” would be granted permission to enter the /home/rj directory and read, write and execute all files inside)

    You’ve noticed missing “-R” in the last command?

    Example: example.pdf inside folder Documents

    “rj” would have right to read and write example.pdf, but it wouldn’t be able to access that file, since it wouldn’t have the rights to open the folder, containing that file itself.

    See 1st screenshot … you’ll notice the red file names.

    So, that’s what went wrong and why.

    Now, if you make it to screw yourself up that way, you’ll (want to, but not necessarily need to) reinstall your system or, you’ll remember that you’re not the only user.

    There’s still “root” user that owns and controls the system.

    At (re~) boot, you can press “e”, look for the Grub line and add “single” at the end.

    See 3rd screenshot.

    This will bring you to: See 4th screenshot.

    There you can log in as root and repair the damage you’ve done before.

    This works with or without GUI — it doesn’t really matter what you choose.
    One way or the other, it’s always the “root” user doing its job inside of the Terminal.

    See screenshots 5 ~ 8.

    Your files are still there and that’s all what matters.

    Once at that point, you could easily create a new user and copy your files back to your new home directory.
    Or, you simply reboot and log in with your username (“rj”) again and pretend that nothing has happened.

    😉

    * This was just a very basic explanation, to give you the idea of what / why it went wrong.
    For proper understanding of Linux rights management, you should read some thorough explanations first!

    P.S.
    Thanks Dave! The copy and paste error while changing 755 into 644. 🙁

    #26224
    Forum Admin
    Dave
    Dave

    644 == rw-r-xr-x (3-bit word, a combination of 4 2 1)

    4 = read
    2 = write
    1 = execute

    644 = rw-r–r–
    Owner rw- (read,write)
    Group r– (read)
    Global r– (read)

    755 = rwxr-xr-x
    Owner rwx (read,write,execute)
    Group r-x (read,execute)
    Global r-x (read,execute)

    I suspect that the major problem was giving the home directory to a different user. ($rj) In the past the home directory was set in fstab to be mounted (and I think can still be set this way) without executable permissions to prevent the user from running a malicious program unintentionally.

    Default now is as noClue is saying
    Files = 644
    Directories = 755

    This should do that (substituting MyUser for your actual username)…
    find /home/MyUser -type d -exec chmod 755 {} \;
    find /home/MyUser -type f -exec chmod 644 {} \;

    But as bobc has said, you should move your extra files with the problem after copying to a separate folder and try to address them there. It may even help to check the permissions of the original on the install you are copying from and compare that to the install you are copying to.

    I am not certain what is meant with the “enter” directory requiring 755. If that is meant as read the contents of a directory all that should be needed is the read bit.

    Computers are like air conditioners. They work fine until you start opening Windows. ~Author Unknown

Viewing 15 posts - 1 through 15 (of 29 total)

You must be logged in to reply to this topic.