LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva
User Name
Password
Mandriva This Forum is for the discussion of Mandriva (Mandrake) Linux.

Notices


Reply
  Search this Thread
Old 03-03-2005, 02:21 PM   #1
gilester
LQ Newbie
 
Registered: Apr 2004
Posts: 3

Rep: Reputation: 0
Default ttyS1 permission setting


Hi. I'm using Mandrake 10.0. I have a script that needs to talk to /dev/ttyS1. The default permission of ttyS1 seems to be 660.

I can 'su' then 'chmod 666 /dev/ttyS1'. This is fine, but when the machine reboots (or, it seems, I log on the the graphical session), the permission is re-set to 660 - and my script fails to access the port.

Does anyone know what setting I need to change to have the default permission of ttyS1 as user-read/writable?

Thanks. Giles.
 
Old 03-03-2005, 09:35 PM   #2
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
Not all that familiar with Mandrake but I assume it uses udev so there's nothing fixed about dev. You could try modifying your udev perms. Better, maybe adding yourself to the tty group (or whatever group owns the device) would work.
 
Old 03-04-2005, 01:29 AM   #3
bunnadik
Member
 
Registered: Jan 2005
Location: Övik, Sweden
Distribution: MDK 10.1
Posts: 450

Rep: Reputation: 30
@digiot: Well, MDK10.1 uses udev, 10.0 uses devfs.

@gilester: Normally devices like some tty's, disks, audio and floppy are owned by the logged in user. This is done
by "session optional pam_console.so" in /etc/pam.d/login or /etc/pam.d/*dm. Make sure you have that entry.
That should also touch a file named as your login in /var/run/console/.

- Peder
 
Old 03-07-2005, 04:13 AM   #4
gilester
LQ Newbie
 
Registered: Apr 2004
Posts: 3

Original Poster
Rep: Reputation: 0
Peder,

Thanks for the reply. I do have the line "session optional pam_console.so" in /etc/pam.d/login, however I do not have anything in /var/run/console. I'm afraid I didn't quite understand what you meant with the touch part. Do I just type "touch /var/run/console/<username>"?

Thanks, Giles.
 
Old 03-07-2005, 05:30 AM   #5
opjose
Senior Member
 
Registered: Sep 2004
Location: Outlying D.C.
Distribution: Mandriva
Posts: 2,090

Rep: Reputation: 46
The file

/etc/udev/permissions.d/00-udev.permissions

sets up the default TTY permissions at boot.

Just change it as needed.
 
Old 03-07-2005, 11:10 AM   #6
bunnadik
Member
 
Registered: Jan 2005
Location: Övik, Sweden
Distribution: MDK 10.1
Posts: 450

Rep: Reputation: 30
@opjose: there is no udev in 10.0 and I don't think it's the right solution even for 10.1

/etc/pam.d/login only runs if you boot in console mode and login (and use startx to start X)
If you boot into X check /etc/pam.d/xdm (or gdm or kdm).

The touching part is done by the console module. You can't do it yourself, it's just an indication
that everything works.

- Peder
 
Old 03-07-2005, 11:44 AM   #7
opjose
Senior Member
 
Registered: Sep 2004
Location: Outlying D.C.
Distribution: Mandriva
Posts: 2,090

Rep: Reputation: 46
My bad on 10.0.

But it does apply for 10.1 as I'm looking at two 10.1 systems with it right now.

It does set the TTY perms as the file itself contains the mode permissions for the ttys.
 
Old 03-07-2005, 11:57 AM   #8
bunnadik
Member
 
Registered: Jan 2005
Location: Övik, Sweden
Distribution: MDK 10.1
Posts: 450

Rep: Reputation: 30
Quote:
It does set the TTY perms
Hmm, my file has "ttyS*:root:uucp:0660" but when I 'ls -la /dev/ttyS1' it's "crw-rw---- 1 peder uucp 4, 65 feb 6 21:08 /dev/ttyS1"
AFAI can see something changed it from root to peder and I know from experimenting with ldap that if you miss
the console.so in pam.d you can't acces a lot of /dev entries you normally can.

- Peder
 
Old 03-07-2005, 01:43 PM   #9
opjose
Senior Member
 
Registered: Sep 2004
Location: Outlying D.C.
Distribution: Mandriva
Posts: 2,090

Rep: Reputation: 46
Yes good point.

Now you are going to force me to step through the boot.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Default home directory permission kumarsundaram Linux - Security 14 06-30-2005 07:33 PM
default permission for home in slack joma Slackware 7 06-20-2005 03:53 PM
Default home directory permission in SUSE 9.1 soldonz Linux - Security 1 05-26-2005 05:41 AM
setting default page size and default tray lived4eva Linux - General 1 11-04-2003 02:39 PM
Reset Default Permission vcheah Linux - Software 1 02-22-2003 07:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva

All times are GMT -5. The time now is 02:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration