scp fails to copy files from sysfs
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
openssh (Ubuntu) |
Triaged
|
Undecided
|
Unassigned |
Bug Description
When I try to copy some files from sysfs directly using scp it fails. This can be reproduced locally with:
ubuntu@ubuntu:~$ scp ubuntu@
ubuntu@localhost's password:
BootOrder-
scp: read remote "/sys/firmware/
The file is readable:
ubuntu@ubuntu:~$ od -b /sys/firmware/
0000000 007 000 000 000 002 000 003 000 000 000 004 000
0000014
And I see this in the journal:
Jun 13 13:30:49 ubuntu sftp-server[5115]: error: process_read: seek "/sys/firmware/
This was working fine in 22.04. Interestingly, using a scp 22.04 client with a 24.04 kernel works fine.
Changed in openssh (Ubuntu): | |
status: | New → Triaged |
Thank you for taking the time to make this bug Alfonso!
I can reproduce this in a noble-vm very easily.
$ lxc launch ubuntu:noble n-vm --vm sshd_config. d/60-cloudimg- settings. conf password/ PermitRootLogin yes/' /etc/ssh/ sshd_config /sys/firmware/ efi/efivars/ BootOrder- 8be4df61- 93ca-11d2- aa0d-00e098032b 8c .
$ lxc shell n-vm
# rm /etc/ssh/
# sed -i 's/#PermitRootLogin prohibit-
# echo "root:pass" | chpasswd
# systemctl restart ssh
# scp root@localhost:
However it's not just every file in /sys/, there are some files you can still scp. For example:
# scp root@localhost: /sys/firmware/ efi/runtime .
You can also cp the efi variable file and then scp it fine. efi/efivars/ BootOrder- 8be4df61- 93ca-11d2- aa0d-00e098032b 8c ./ /root/BootOrder -8be4df61- 93ca-11d2- aa0d-00e098032b 8c ./
# cp /sys/firmware/
# scp root@localhost: