Using a computer with Ubuntu 16.04 (no update suggestions please) I mounted /proc/
at my Raspberry Pi 3B + (linux kernel version 4.19.88) via SSHFS:
sshfs pi@192.168.0.4:/proc ~/procAtPi
ls -la ~/procAtPi
Here ls
shows me all files in the Pi's /proc
without any problems, just as I had connected directly via ssh. But when I try to read the files with cat
, nothing is displayed here. The file content is only output to me when I connect directly via
user@remote:~$ ssh pi@192.168.0.4
pi@192.168.0.4:~$ cat /proc/stat
How can I read out a file from procfs that I access via SSHFS?
Some more observations I made:
Using
sudo cat ~/procAtPi/stat
leads toAccess denied
(So root seems to have fewer access rights than the normal user?) but the files owner is root:user@remote:~$ ls -lai ~/procAtPi/stat 16 -r--r--r-- 1 root root 0 Dez 24 00:00 stat
The displayed owner differs depending on the access:
user@remote:~$ ls -lai ~/procAtPi/ ... 171 dr-xr-xr-x 1 user user 0 Jan 20 09:18 11045 ... pi@192.168.0.4:~$ ls -lai /proc/ ... 2035700 dr-xr-xr-x 8 pi pi 0 Jan 20 09:18 11045 ...
Remote access to files in the Pi's sysfs (
/sys/
) seems to work fine.
A current workaround is to run a server on the Pi that reads the data from /proc/stat
and makes it available via TCP. To do so, however, I have to start the server manually every time (I don't want an autostart because I don't need it all the time). I need access to proc/stat
for a htop
-like program that is supposed to monitor my Pi cluster.