Score:0

Permission error when trying to copy via ssh

wf flag

Some time ago most of my files changed their attributes to extent. Not sure how or when did it happened, but when I list all files attrs in example folders it looks like this:

user@user:~/Downloads$ lsattr *
--------------e------- balenaEtcher-1.7.9-x64.AppImage
--------------e------- balena-etcher-electron-1.7.9-linux-x64.zip
--------------e------- control.tar.xz
--------------e------- data.tar.xz
--------------e------- debian-binary
--------------e------- DisplayLink USB Graphics Software for Ubuntu5.6-EXE/displaylink-driver-5.6.0-59.176.run
--------------e------- DisplayLink USB Graphics Software for Ubuntu5.6-EXE/DisplayLink USB Graphics Software for Ubuntu 5.6.0-59.176-Release Notes.txt
--------------e------- DisplayLink USB Graphics Software for Ubuntu5.6-EXE.zip
--------------e------- ubuntu-22.04.1-desktop-amd64.iso

I've read somewhere that it can be connected to partition of the disk, but I am not sure how to check it. I am pretty new ubuntu user. It causes a lot of problems since I can't modify, copy or delete any of the files. Any ideas how to fix the issue?

EDIT: I first observed it, when I tried to copy some files via ssh. I've created some test file test.txt and tried to move it to root@192.168.0.10

user@user:~/Documents$ lsattr test.txt
--------------e------- test.txt
user@user:~/Documents$ scp test.txt root@192.168.0.10:/
root@192.168.0.10's password:
scp: /test.txt: Permission denied
user@user:~/Documents$

Permissions of this files

user@user:~/Documents$ ls -la
drwxr--r--  4 user user 4096 paź 18 19:48 .
drwxr-x--- 26 user user 4096 paź 18 20:04 ..
drwxrwxr-x  8 user user 4096 wrz 21 15:53 old
drwxrwxr-x  3 user user 4096 paź 18 07:52 Projects
-rw-rw-r--  1 user user    9 paź 18 19:46 test.txt

Another weird thing is, I can't remove some of directories. For example when trying to remove "old" dir:

user@user:~/Documents/old$ ls
output-analyzer  test_dir
user@user:~/Documents/old$ rm -r test_dir/
rm: cannot remove 'test_dir/': Operation not permitted

Output of findmnt command:

user@user:~$ findmnt
TARGET                                   SOURCE           FSTYPE  OPTIONS
/                                        /dev/nvme0n1p2   ext4    rw,relatime,er
├─/sys                                   sysfs            sysfs   rw,nosuid,node
│ ├─/sys/kernel/security                 securityfs       securit rw,nosuid,node
│ ├─/sys/fs/cgroup                       cgroup2          cgroup2 rw,nosuid,node
│ ├─/sys/fs/pstore                       pstore           pstore  rw,nosuid,node
│ ├─/sys/firmware/efi/efivars            efivarfs         efivarf rw,nosuid,node
│ ├─/sys/fs/bpf                          bpf              bpf     rw,nosuid,node
│ ├─/sys/kernel/debug                    debugfs          debugfs rw,nosuid,node
│ ├─/sys/kernel/tracing                  tracefs          tracefs rw,nosuid,node
│ ├─/sys/fs/fuse/connections             fusectl          fusectl rw,nosuid,node
│ └─/sys/kernel/config                   configfs         configf rw,nosuid,node
├─/proc                                  proc             proc    rw,nosuid,node
│ ├─/proc/sys/fs/binfmt_misc             systemd-1        autofs  rw,relatime,fd
│ │ └─/proc/sys/fs/binfmt_misc           binfmt_misc      binfmt_ rw,nosuid,node
│ └─/proc/fs/nfsd                        nfsd             nfsd    rw,relatime
├─/dev                                   udev             devtmpf rw,nosuid,rela
│ ├─/dev/pts                             devpts           devpts  rw,nosuid,noex
│ ├─/dev/shm                             tmpfs            tmpfs   rw,nosuid,node
│ ├─/dev/hugepages                       hugetlbfs        hugetlb rw,relatime,pa
│ └─/dev/mqueue                          mqueue           mqueue  rw,nosuid,node
├─/run                                   tmpfs            tmpfs   rw,nosuid,node
│ ├─/run/lock                            tmpfs            tmpfs   rw,nosuid,node
│ ├─/run/credentials/systemd-sysusers.service
│ │                                      none             ramfs   ro,nosuid,node
│ ├─/run/rpc_pipefs                      sunrpc           rpc_pip rw,relatime
│ ├─/run/snapd/ns                        tmpfs[/snapd/ns] tmpfs   rw,nosuid,node
│ │ ├─/run/snapd/ns/snapd-desktop-integration.mnt
│ │ │                                    nsfs[mnt:[4026533314]]
│ │ │                                                     nsfs    rw
│ │ └─/run/snapd/ns/snap-store.mnt       nsfs[mnt:[4026533318]]
│ │                                                       nsfs    rw
│ └─/run/user/1000                       tmpfs            tmpfs   rw,nosuid,node
│   ├─/run/user/1000/gvfs                gvfsd-fuse       fuse.gv rw,nosuid,node
│   └─/run/user/1000/doc                 portal           fuse.po rw,nosuid,node
├─/snap/bare/5                           /dev/loop0       squashf ro,nodev,relat
├─/snap/code/108                         /dev/loop1       squashf ro,nodev,relat
├─/snap/code/111                         /dev/loop2       squashf ro,nodev,relat
├─/snap/core/13741                       /dev/loop3       squashf ro,nodev,relat
├─/snap/core/13886                       /dev/loop4       squashf ro,nodev,relat
├─/snap/core20/1611                      /dev/loop5       squashf ro,nodev,relat
├─/snap/core20/1623                      /dev/loop6       squashf ro,nodev,relat
├─/snap/firefox/1943                     /dev/loop7       squashf ro,nodev,relat
├─/snap/firefox/1969                     /dev/loop8       squashf ro,nodev,relat
├─/snap/gnome-3-38-2004/115              /dev/loop9       squashf ro,nodev,relat
├─/snap/gnome-3-38-2004/119              /dev/loop10      squashf ro,nodev,relat
├─/snap/gtk-common-themes/1534           /dev/loop11      squashf ro,nodev,relat
├─/snap/gtk-common-themes/1535           /dev/loop12      squashf ro,nodev,relat
├─/snap/notepad-plus-plus/374            /dev/loop13      squashf ro,nodev,relat
├─/snap/notepad-plus-plus/375            /dev/loop14      squashf ro,nodev,relat
├─/snap/snap-store/592                   /dev/loop15      squashf ro,nodev,relat
├─/snap/snap-store/599                   /dev/loop16      squashf ro,nodev,relat
├─/snap/snapd/17029                      /dev/loop17      squashf ro,nodev,relat
├─/snap/snapd-desktop-integration/10     /dev/loop19      squashf ro,nodev,relat
├─/snap/snapd/17336                      /dev/loop18      squashf ro,nodev,relat
├─/snap/snapd-desktop-integration/14     /dev/loop20      squashf ro,nodev,relat
├─/snap/wine-platform-7-devel-core20/19  /dev/loop21      squashf ro,nodev,relat
├─/snap/wine-platform-7-devel-core20/20  /dev/loop22      squashf ro,nodev,relat
├─/snap/wine-platform-runtime-core20/38  /dev/loop23      squashf ro,nodev,relat
├─/snap/wine-platform-runtime-core20/42  /dev/loop24      squashf ro,nodev,relat
├─/var/snap/firefox/common/host-hunspell /dev/nvme0n1p2[/usr/share/hunspell]
│                                                         ext4    ro,noexec,noat
└─/boot/efi                              /dev/nvme0n1p1   vfat    rw,relatime,fm
mook765 avatar
cn flag
No, it doesn't cause any problems. It is not the reason for you to be unable to copy, delete or modify the files. Sounds more like a permission issue but you didn't tell us what the error messages are when you try to do so.
zorka5 avatar
wf flag
@mook765 thank you for response. Ifirst observed it, when I tried to copy some files via ssh. I've created some test file test.txt and tried to move it to root@ip_addres ` user@user:~/Documents$ lsattr test.txt --------------e------- test.txt user@user:~/Documents$ scp test.txt root@192.168.0.10:/ root@192.168.0.10's password: scp: /test.txt: Permission denied ` I don't think the problem is with ssh itself, I've already done this several times before, but now when this extent attr is changed copying files.
mook765 avatar
cn flag
It has nothing to do with the extend attribut, it is a permission issue. Please edit your question to provide details about what and how you do and the the entire error message. Don't use comments to provide details, it's not readable in comments.
zorka5 avatar
wf flag
@mook765 thank you. What else should I investigate to know where the problem is? I thouht that it may be connected to extent flag, since previously it was different and I don't know when and why it stopped working.
mook765 avatar
cn flag
`Operation not permitted` sounds like a mount issue, is the filesystem mounted read-only probably due to file system corruption? `findmnt` is a very useful command to check that out. Otherwise I'm out of ideas, hopefully someone else can give you some clue.
zorka5 avatar
wf flag
@mook765 I've provided output of findmnt command. Not sure what should I look for there.
mook765 avatar
cn flag
The output of `findmnt` looks good, filesystem is mounted rw.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.