System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

modem device file permission change

SOLVED
Go to solution
Sunny123_1
Esteemed Contributor

modem device file permission change

Hi I want to aceess my modem device file given below

ls -l /dev/tty2a7

crw--w--w- 1 bin bin 44 0x020600 May 20 11:30 /dev/tty2a7

It is default permission i have change it to 777.Now i want to set it permanantly.Is this possible????Is this secure???/

Regards
Sunny
6 REPLIES
Suraj K Sankari
Honored Contributor

Re: modem device file permission change

Hi,
Yes its possible to change the permission see the output below

mknod [OPTION]... NAME TYPE [MAJOR MINOR]

[root@rspc521 tmp]# mknod /tmp/abc c 44 0x020600
[root@rspc521 tmp]# ll abc
crw-r--r-- 1 root root 46, 0 May 21 17:50 abc

[root@rspc521 tmp]# chmod 622 abc
[root@rspc521 tmp]# ll abc
crw--w--w- 1 root root 46, 0 May 21 17:50 abc

Suraj
Sunny123_1
Esteemed Contributor

Re: modem device file permission change

But i want to change it permanantly how it is possible

Regards
Sunny
Matti_Kurkela
Honored Contributor
Solution

Re: modem device file permission change

Setting to 777 is silly, because the modem device is not executable. You will never want to execute the raw incoming data as a program or a script.

Setting it to 666 makes a bit more sense, but may be bad security: it allows everyone to access the modem, AND it allows everyone to eavesdrop on or terminate everyone else's connections.

The optimal setup is a bit more complicated:

(Note: if you are going to use UUCP, don't do this. UUCP was an old system of automating the transfer of email and files when using only modem connections. Today UUCP is very rarely used, but HP-UX still has the facilites for it included in the standard installation. If you are going to use it, read the man pages of the UUCP programs to find the instructions for the proper modem setup for UUCP. I'm assuming you don't need UUCP.)

You should create a new group (e.g. "groupadd modem"), then make the modem accessible by this group only:
chgrp modem /dev/tty2a7
chmod 660 /dev/tty2a7 # permissions crw-rw----

Then make a list of the programs your users are supposed to use with the modem, and add setgid modem permissions to these programs:

chgrp modem /some/application/somewhere
chmod g+s /some/application/somewhere

This special permission setting makes the user running the application become a member of the modem group *only when running this application*.

You should also change the group of the /var/spool/locks directory:
chgrp modem /var/spool/locks

The /var/spool/locks directory should be group writeable by default.

Many modem-using applications can create UUCP-style lock files when properly configured: in this case, the application should create a file named /var/spool/locks/LCK..tty2a7 when starting to use the modem, and delete it when done. The file should contain the PID number of the application process.

If the application detects this file already exists when the application is starting, it can verify that the PID listed in the lock file really exists. If it does, the application can display a message "the modem is in use by someone else" and either exit or wait for the modem to become free.

If the lock file exists but the PID number listed in it does not match any running process, the application that was using the modem before has apparently crashed. In this case (only) the new application can overwrite the lock file and start using the modem. Usually the application should notify the user in this situation. The typical message is something like "Stale lock file detected and removed."

MK
MK
Sunny123_1
Esteemed Contributor

Re: modem device file permission change

Hi Thanks for your replay I got solution.But how to fix this permanant.Becauuse after reboot it gets default permission.

Regards
Sunny
Viktor Balogh
Honored Contributor

Re: modem device file permission change

as a workaround you could write a small script that sets the wanted permission on this file. unfortunately i don't know from where the permissions are coming. on suse there is a permissions-daemon that sets the permissions for the system files back.
****
Unix operates with beer.
Sunny123_1
Esteemed Contributor

Re: modem device file permission change

Thanks for your reply.

Regards
Sunny