1834313 Members
2249 Online
110066 Solutions
New Discussion

permission

 
Indrajit Bhagat
Regular Advisor

permission

How to set the character device file permisison like crw-r--r--

Any help will highly appreciated.
6 REPLIES 6
Ivan Krastev
Honored Contributor

Re: permission

Use chmod:
chmod 644 file

regards,
ivan
Indrajit Bhagat
Regular Advisor

Re: permission

Hi Tried that one but it is simply giving the

My Computer /tmp =>chmod 644 abcd
My Computer /tmp =>ls -lrt|grep -i abcd
-rw-r--r-- 1 root sys 0 Oct 14 14:26 abcd
James R. Ferguson
Acclaimed Contributor

Re: permission

Hi:

If your question is how to make a character device, then use 'mknod'. For example:

# umask 022
# mknod /tmp/chardev1 c 64 0x000000
# mknod /tmp/chardev2 c 205 0x000000

Regards!

...JRF...

Ganesan R
Honored Contributor

Re: permission

Hi,

Couly you explain what you trying to do?

It looks you have copied the device file to tmp and trying to change the permission.
You can change the device file permission with chmod but not the type of file(charactor or block).

you need to use mknod command to create the device file either block or raw.

You can even use insf -e to recreate the missing device files

Best wishes,

Ganesh.
Adam W.
Valued Contributor

Re: permission

Here is a great listing of permission using octal numerics:

400 Owner has read permission
200 Owner has write permission
100 Owner has execute permission
040 Group has read permission
020 Group has write permission
010 Group has execute permission
004 Others have read permission
002 Others have write permission
001 Others have execute permission


I found this useful but they are actually simple to memorize.
There are two types of people in the world, Marines and those who wish they were.
Dennis Handly
Acclaimed Contributor

Re: permission

>Adam: Here is a great listing of permission using octal numerics:

You can forget about this deprecated octal foolishness: :-)
u+r Owner has read permission
u+w Owner has write permission
u+x Owner has execute permission
g+r Group has read permission
g+w Group has write permission
g+x Group has execute permission
o+r Others have read permission
o+w Others have write permission
o+x Others have execute permission

Besides "+", you can use "-" and "=".