Results 1 to 3 of 3

Thread: A file permissions puzzle

  1. #1
    Junior Member registered user
    Join Date
    Sep 2005
    Posts
    20

    A file permissions puzzle

    Just as I thought that I was getting a bit familiar with bash, there came the following perplexing puzzle:

    knoppix@1[my-scripts]$ su
    root@1[my-scripts]# ls -l
    total 32
    -rwxr-xr-x 1 knoppix knoppix 1090 Nov 27 2006 my-html-script
    root@1[my-scripts]# my-html-script > my-file.html
    bash: my-html-script: command not found
    root@1[my-scripts]# gedit my-html-script
    root@1[my-scripts]# gedit my-html-script
    root@1[my-scripts]# exit
    exit
    knoppix@1[my-scripts]$ my-html-script > my-file.html
    knoppix@1[my-scripts]$

    As it can be seen from the above, although su has permission to run my-html-script, the latter does not run. The same script runs normally for user knoppix. Furthermore, although su is not permitted to write to my-html-script I was able to modify the latter while logged in as su. How come?


  2. #2
    Senior Member registered user
    Join Date
    Mar 2004
    Posts
    1,516
    the first I suspect you need to give full path
    /home/knoppix/my-html-script > my-file.html

    on the second, su=root=GOD!
    root can do ANYTHING, even destroy the computer hardware that is, if you know how, perhaps in some extreme case, by sheer bad luck.

    by destroy I mean something like, hmm, hard to choose one from list of bad things.
    i think this will ilustrate,
    it is quite possible to wipe proms and thus permanently trash DVD, CD, BIOS, HDD...
    by permanently I mean it requires sending back to manufacturer to repair hardware (or having preprogrammed replacement parts and a good electronic background), and likley professional help on recovering the data in the HDD.

  3. #3
    Junior Member registered user
    Join Date
    Sep 2005
    Posts
    20
    the first I suspect you need to give full path
    Well, perhaps. However, with the full path being
    KNOPPIX.IMG/home/knoppix/my-scripts/my-html.script > my-file.html
    this is not a particularly attractive option. A better option I stumbled upon accidentally after I posted originally is
    ./my-html-script > my-file.html
    which worked for me but probably requires adding beforehand (already done in my case) the full path to my-html-script to the collection of standard paths the shell goes to when it has to execute a script.

    on the second, su=root=GOD!
    root can do ANYTHING, even destroy the computer.....
    Fine! This is indeed what everyone associates with root except perhaps the destruction part. But with this in mind, what is the reason for having the last three characters in a string like - rwx r-x r-x? Shouldn't it read - rwx r-x instead? Furthermore what about running chmod to change file permissions to, say, 755 when what you really get is 757? Isn't the whole idea of file permissions utterly inconsistent and indeed deceiving?

Similar Threads

  1. Adjust permissions in .cmg-file
    By tomvollerthun in forum Klik
    Replies: 3
    Last Post: 10-06-2005, 11:10 AM
  2. File recovery / File permissions help needed?
    By sepekte in forum General Support
    Replies: 0
    Last Post: 05-11-2005, 11:48 PM
  3. New User Help on file permissions
    By chachi in forum General Support
    Replies: 1
    Last Post: 07-13-2004, 01:29 AM
  4. File permissions keep changing...
    By hhayes in forum General Support
    Replies: 0
    Last Post: 02-17-2004, 10:58 PM
  5. Changing file permissions
    By bigbene in forum General Support
    Replies: 0
    Last Post: 11-16-2003, 05:35 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


1TB/2TB USB 3.0 Flash Drive Thumb U Disk Memory Stick Pen PC Laptop Storage lot picture

1TB/2TB USB 3.0 Flash Drive Thumb U Disk Memory Stick Pen PC Laptop Storage lot

$80.39



Monterey - Apple MacBook Pro 15

Monterey - Apple MacBook Pro 15" 1TB SSD 16GB i7 3.40Ghz Retina - ALLSTATE

$499.50



Seagate ST1000VM002 1TB 64MB SATA6Gb/s 3.5

Seagate ST1000VM002 1TB 64MB SATA6Gb/s 3.5" (Low Power) Hard Drive -PC, CCTV DVR

$24.99



Type C USB 3.0 Flash Drive Thumb Drive Memory Stick for PC Laptop 1TB 2TB lot picture

Type C USB 3.0 Flash Drive Thumb Drive Memory Stick for PC Laptop 1TB 2TB lot

$73.29



Patriot P210 128GB 256GB 512GB 1TB 2TB 2.5

Patriot P210 128GB 256GB 512GB 1TB 2TB 2.5" SATA 3 6GB/s Internal SSD PC/MAC Lot

$19.99



Samsung - Geek Squad Certified Refurbished 870 EVO 1TB SATA Solid State Drive picture

Samsung - Geek Squad Certified Refurbished 870 EVO 1TB SATA Solid State Drive

$67.99



1TB HDD/SSD 2.5

1TB HDD/SSD 2.5" SATA Hard Drive with Windows 10 or Windows 11 Pro Installed

$29.99



1TB SATA 3.5

1TB SATA 3.5" HDD Mixed Brand Mixed Speed WD HGST Seagate Hitachi

$12.95



EXCELLENT Apple MacBook Pro 13 RETINA INTEL CORE i7 1TB SSD 16GB RAM - Monterey picture

EXCELLENT Apple MacBook Pro 13 RETINA INTEL CORE i7 1TB SSD 16GB RAM - Monterey

$499.50



Lenovo  LOQ Laptop, i7-13700H, GB, Up to 1TB SSD, Up To Win 11 Pro picture

Lenovo LOQ Laptop, i7-13700H, GB, Up to 1TB SSD, Up To Win 11 Pro

$701.09