LinHES Forums
http://forum.linhes.org/

Owner Issue
http://forum.linhes.org/viewtopic.php?f=21&t=21872
Page 1 of 1

Author:  falinskip [ Mon Nov 01, 2010 6:39 pm ]
Post subject:  Owner Issue

Hi People,

(Ever make one of those really dumb mistakes), well I had a owner issue recently with a couple files (and changed the owner of the myth directory) back to myth. I am not sure what happen there. I ended up messing up the owner of my MythWeb. The commands I used to mess everything up was

chown mythtv:mythtv /myth/tv/*.mpg
chown mythtv:mythtv /myth/tv/*.mpg
chown mythtv:mythtv /myth

My question would be does anyone know what I have to do to correct the owner of mythweb.

It would be a great help if anyone could point me in the right direction.

Thanks again.

Author:  knappster [ Tue Nov 02, 2010 9:54 pm ]
Post subject: 

Which version are you on? On R6.03 mythweb is in the following folder:
Code:
/data/srv/httpd/htdocs/mythweb
owned by httpd:users. I think that you will need to find the mythweb folder and make sure the owner is httpd.

I'm not sure how your chown commands would effect anything with mythweb. However, on my box, /myth is owned by mythtv:users and some of the files in /myth/tv are mythtv:mythtv and others are mythtv:users.

Author:  falinskip [ Wed Nov 03, 2010 11:00 am ]
Post subject: 

I am on version R6.03, I will check the owner tonight. Thanks for pointing me in the right direction there. I will post the fix (once I figure it out).

Thanks again for the help.

Author:  falinskip [ Sat Nov 06, 2010 8:01 am ]
Post subject: 

Thanks, I seem to have fixed it with running

chown mythtv:users /myth
and then
chown mythtv:mythtv /myth/tv/*

Thanks again, my mythweb is working.

Author:  tjc [ Sat Nov 06, 2010 8:32 am ]
Post subject: 

There are actually a relatively small set of files under /myth that have http as their group:
Code:
# find /myth -ls | grep http
25649153    4 drwxr-xr-x   2 mythtv   http         4096 Oct 24 16:13 /myth/ipodfeed
25649155    0 lrwxrwxrwx   1 mythtv   http           25 Oct 24 16:13 /myth/ipodfeed/index.php -> /myth/ipodfeed/m2iweb.php
25649154    8 -rwxr-xr-x   1 mythtv   http         6350 May 24 20:29 /myth/ipodfeed/m2iweb.php
18161669    4 drwxr-xr-x   2 mythtv   http         4096 Jun 10  2007 /myth/video/archive
18161670    0 -rwxrwxrwx   1 mythtv   http            0 Dec 25  2009 /myth/video/archive/.media
18161673    0 lrwxrwxrwx   1 mythtv   http           31 Oct 24 16:13 /myth/video/archive/index.php -> /myth/video/archive/archive.php
18161671    8 -rwxr-xr-x   1 mythtv   http         6413 Jan 18  2010 /myth/video/archive/archive.php

OBTW - /myth/backup and everything under it should be owned by root
Code:
chown -R root:root /myth/backup
chmod go-rwx /myth/backup/*

Author:  mattbatt [ Sun Nov 07, 2010 10:34 pm ]
Post subject: 

I wish the backup files were owned by mythtv it would make backing up on anohter computer easier.

Author:  tjc [ Mon Nov 08, 2010 9:39 pm ]
Post subject: 

Well it's your machine, and you're certainly free to chmod files, but the ownership and permissions were set up that way to keep unprivileged users from accessing privileged information.

Author:  mattbatt [ Mon Nov 08, 2010 10:06 pm ]
Post subject: 

Sorry I should have been more specific the backup routine runs as root (or SUDO I can't remember which) that inherently makes the files owned by root. I just don't have enough knowledge to know why it's running as root are there root owned files that need to be changed. The easier solution in my case might be to examine the script that runs the backup and make the last line change the files to MythTV owned.

Author:  tjc [ Tue Nov 09, 2010 8:34 pm ]
Post subject: 

It runs as root because a less privileged user doesn't have permissions to read all the file needed for the backup. It keeps the resulting files owned by root for the same reason.

To make a long story short, the backup files are owned and only readable by root for the same reason that computer systems have passwords and privilege levels and permissions in the first place. If the backups aren't protected they provide a backdoor to the information that you generally don't want other people having or fiddling with.

This extends far beyond the obvious. Limiting permissions also keeps you from accidentally shooting yourself in the foot. I've had testing versions of MythTV choke, puke and start deleting files when the backup drive was on-line. Because it was running as mythtv and not root the backups were protected and I was able to recover.

Author:  nmcaullay [ Wed Nov 10, 2010 11:26 pm ]
Post subject: 

I updated the /usr/LH/bin/mythbackup script to change the permissions of the backed-up files.

Once a week I scp from work to home, and backup my files, and my remote access is tied down by a private/publickey/passphrashe, so i dont feel exposed having my backup files readable by the mythtv user.

The change I made is below
Code:
# If you can't read this you've got no business restoring from it anyway.
$CHOWN root:root $BACKUP_TAR* $BACKUP_SQL*
$CHMOD go-rwx $BACKUP_TAR* $BACKUP_SQL*
#ADDED THIS BIT
$CHMOD o+r $BACKUP_TAR* $BACKUP_SQL*


It might help you out?

Nathan

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/