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 ?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
Check if you are really superuser with:
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 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:
the directory is mounted with read-only permissions: type in terminal:
cat /proc/mounts (or
and check the output, if directory is mounted read-only.
If you are in the first case, change the directory attributes with
chattr -i <file/dir>
chattr +i <file/dir>
If you're in the latter case, edit the file
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:
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