-
Junior Member
registered user
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?
-
Senior Member
registered user
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.
-
Junior Member
registered user
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
-
By tomvollerthun in forum Klik
Replies: 3
Last Post: 10-06-2005, 11:10 AM
-
By sepekte in forum General Support
Replies: 0
Last Post: 05-11-2005, 11:48 PM
-
By chachi in forum General Support
Replies: 1
Last Post: 07-13-2004, 01:29 AM
-
By hhayes in forum General Support
Replies: 0
Last Post: 02-17-2004, 10:58 PM
-
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
-
Forum Rules

(New) AMD Ryzen 7 5700X 8 Core 16 Thread AM4 Unlocked 3.4 GHz CPU OEM Tray
$174.99

HP ZBook Firefly 14" G8 Mobile Workstation i5 11th Gen 16GB RAM 256 GB SSD No AC
$184.99

Dell Optiplex 7050 Micro Core i5-7500 8 GB RAM 256GB SSD Microsoft Windows 11
$89.99

Home Assistant Server | 8GB RAM | 128GB SSD | Intel i5 Quad-Core | Dell OptiPlex
$159.99

Intel Xeon E5 - 2667V2 / SR19W 3.30GHz 25MB 8-Core CPU Socket LGA2011
$30.00

AMD FX 8350 8-CORE 4.00GHz CPU FD8350FRW8KHK SOCKET AM3+ *QTY
$39.99

AMD Ryzen 7 9700X 8-Core 16-Thread 40MB Cache Socket AM5 9000 Series Processor
$245.99

Microsoft Surface Go 2 Laptop Core i5 1135G7 2.4GHz 8GB 128GB SSD
$179.99

SGIN 17.3" Laptop Intel Quad-Core Up to 2.4 GHZ 8GB RAM 256GB SSD HD
$229.99

Intel Core i7-10700 8-Core 16-Thread 2.9GHz Desktop CPU LGA1200 SRH6Y Z490 Z590
$129.00