I have a problem to read out the secret file on Openbian.
I get every time the error Permisson denied and I dont know how to I can get the permission.
I have installet Openbian on a Raspbery Pi 4 4GB.
Login as user root or use root privileges.
As long as SE Linux is not used user root has all privileges.
sudo cat secret
Using sudo gives higher privileges to the cat command.
I tryed it but I have the same problem “Permisson denied”.
What are the permissions of that file:
ls -l YourFileNameHere
I can not read out the permission that way bescause when I search the file the file can not be found. The only way to get to the file is directly (/var/lib/openhab2/openhabcloud/secret).
Ok. Then either do
ls -l /var/lib/openhab2/openhabcloud/secret
cd /var/lib/openhab2/openhabcloud/ ls -l secret
Permissions on my system are as follows:
ls -ld /var/lib/openhab2/openhabcloud /var/lib/openhab2/ /var/lib/ /var/lib/openhab2/openhabcloud/secret drwxr-xr-x 64 root root 4096 May 9 21:19 /var/lib/ drwxr-xr-x 14 openhab openhab 4096 Aug 29 21:16 /var/lib/openhab2/ drwxr-xr-x 2 openhab openhab 4096 Feb 2 2019 /var/lib/openhab2/openhabcloud -rw-r--r-- 1 openhab openhab 20 Feb 2 2019 /var/lib/openhab2/openhabcloud/secret
The Permission is: -rw-rw-r-- 1 openhab 20 Sep 20 15:45 secret
Ok. looks similar to that what I have just the group or user is not listed.
But I assume that it is the same at your side ( openhab openhab ).
In case also the directory privileges are all the same then all users should be able to read the file.
Your are able to get a root shell ( sudo bash ); cd into the directory and open the file with cat or with more ?
How did I do this exectly with this root shell? becaus I am not good at linux and co.
- login to your Pi with the openhabian user that was set during configuration/setup ( openhabian is the default ) and the related password ( openhabian is the default )
- enter the command: sudo bash
- you will be asked for a password ( enter openhabians password; reps. the password of the user you are logged in with )
- in case the password is correct you should have a root shell
- you can check if you have a root shell by entering id the result should show: uid=0 ( root )
ok I have now a root shell
Ok I have the secret with sudo cat /var/lib/openhab2/openhabcloud/secret finally found thank you so much for your help!