I want copy to /lib/udev but gives error
cp -f /tmp/ok_pcscd_hotplug.sh /lib/udev
cp:cannot create regular file /lib/udev/ok_pcscd_hotplug : Permission denied
I am root , but I can't understand . what can I do ?
I want copy to /lib/udev but gives error
cp -f /tmp/ok_pcscd_hotplug.sh /lib/udev
cp:cannot create regular file /lib/udev/ok_pcscd_hotplug : Permission denied
I am root , but I can't understand . what can I do ?
Check if you are really superuser with:
whoami
if the output is root, then you are superuser and you can make the copy of the file with:
cp -f /tmp/ok_pcscd_hotplug.sh /lib/udev/.
otherwise you have to use sudo:
sudo cp -f /tmp/ok_pcscd_hotplug.sh /lib/udev/.
If you're still not able to write to the directory, then it is possible that:
lsattr.the directory is mounted with read-only permissions: type in terminal:
cat /proc/mounts (or mount or cat /etc/mtab)
and check the output, if directory is mounted read-only.
If you are in the first case, change the directory attributes with chattr;
chattr -i <file/dir>chattr +i <file/dir>If you're in the latter case, edit the file /etc/fstab.
Its not necessary every time that you need to be root for this purpose So if you want to do it with root user its fine, but if you want to do it without root, then you have 2 options:
You should create directory first if /lib/udev doesn't exist
mkdir -p /lib/udev
First do " ls -l " and check the permissions for this directory. If you see something like -rw-r--r-- , that means Owner can read-write, Usergroup can only read, World can only read. Type in the following command if this be the case : " chmod 766 ". This will allow you to perform read-write operations on that file. Now try copying that file the same way. It should work