Announcement

Collapse
No announcement yet.

Can't access home directory with Live CD

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Can't access home directory with Live CD

    Hi

    Not an issue as yet, although it might become one some time. Happened in Karmic as well.

    All going well at the moment although if I load a live CD I can see my home directory but when clicking on the directory icon I get the message about not having permission. This kind of defeats the object of having a live CD as a rescue medium.

    This must be contrasted with my wife's UNR netbook where the files are both visible and usable.

    Is there something about the kubuntu hierarchy that I don't know or am I overlooking something obvious?

    Thanks

    Ian


    #2
    Re: Can't access home directory with Live CD

    Well, seems to me everything is working as it's supposed to. Unless your UID and GID are the same, there should be some security.

    The things to look at are:

    1. Obviously look at the permissions of the /home/<USERNAME> directories on both computers and compare.

    /home should be drwxr-xr-x
    /home/<USERNAME> will be the same or maybe not...

    2. Default permissions are set by UMASK. Boot to your OS (not the livecd) and open a terminal. Type umask and note the output. Then type sudo -i and then umask and note those results.

    Do this on both computers and report your results.

    Please Read Me

    Comment


      #3
      Re: Can't access home directory with Live CD

      Thanks very much for your input.

      Okay, the results on both machines were the same under both

      umask

      sudo -i umask

      The output was 0022 under all scenarios.

      I think I can see how it happens. The UNR netbook allows only the user to create and delete files but allows access to all other members of the group. As a result, when I tested the netbooks compatabilty with Lucid, I was able to open documents in the home directory. With my laptop, I as user has full access but everyone else is forbidden. Whilst that must be I suppose sensible there are 3 points that arise:

      1. In normal use I use autologin - as a result that security is circumvented (although I have a hard drive password that needs to be entered at boot). I expect I should stop doing that!

      2. In the event that recovery is needed, using a live cd, will my inability to access the user directory prevent me coying the data to a hard drive?

      3. If not, is it in any way feasible for me to login as user with the aid of a live cd thus accessing (and possibly saving) the data?

      Would welcome your views on that as this issue has been bugging me a little while now. Also, do you think I should change the settings on the netbook, which belongs to my wife? She is logged in automatically, as she would become irritated by having to login every time.

      Comment


        #4
        Re: Can't access home directory with Live CD

        I would hate to make a recommendation as to how you should set up you security but if your wife's laptop stays at home, in my opinion auto-login is OK. If she takes it out of the house EVER - I would definitely not use auto login. If she rarely takes it to go - like on vacation. You could just remove auto log in before it leaves the house.

        As far as accessing directories/files: Since you didn't mention it, I assume you're not using encrypted partitions. For a full recovery, you would need root access anyway so that shouldn't be an issue.

        Your umask is standard.

        What are your primary group assignments? The default is a personal group the same as your username. So user bob defaults to primary group bob.

        A directory listing of his home might look like

        Code:
        bob@home:~$ ls -l ~
        total 22
        drwxr-xr-x 2 bob bob 1408 10.05.2010 10:32 Desktop/
        UserID and GroupID (referring to the lettered names) are stored in the passwd file and are assigned to UID and GID (referring to the user and group numbers). The default is to begin user and group ID numbers at 1000. so the same directory listing with numeric UID/GID is:

        Code:
        bob@home:~$ ls -ln ~
        total 22
        drwxr-xr-x 2 1000 1000 1408 10.05.2010 10:32 Desktop/
        The reason this is significant is: If you use the same UID/GID on all your computers you can access all your files and transfer them back and forth with less worries about permissions getting messed up. The lettered user and group names are insignificant.

        Back to your questions:

        1. Depends on your security needs and the points I made above. My desktop is auto-login and my laptop is not.

        2. System recovery would need root level access so copying data wouldn't be an issue per se.

        3. If you log in using the same UID/GID (which is not the default behavior) you could. The way you could do this is to boot the live CD, create a user account using the same UID/GID. log out, log in as the newly created user, then access will be granted. Sounds like alot doesn't it? Using superuser (aka root) access is simpler. The issue then becomes the default behavior when you copy a file you have access to - it's changes to the copying user's ID and GID. There are ways to fix that also.

        You can if you wish change the group permissions on your home directory so it behaves the same as the other computer.

        There's lots of other options. My home network has five full-time computers on it, three of which are linux. I use a common GID and a tighter umask for my home directories. To me - this keeps my personal files safer while making sharing files easier.

        You can also set whats called the group "sticky bit" which forces all files saved to a directory with that bit set to change to the same group as the directory. Then you create a shared group and give make all users members. I use the group name "shared" (brilliant, huh? ). Then everyone in the group can create and delete from the shared directories but has no access rights to anyones home directories.

        There are several ways to control access - depends on your security needs and your daily needs. If your only need is to have recovery access, I wouldn't change anything - since you're the admin, just use root access.

        One of the best ways to preserve your personal data is to use a separate partition for /home. Then you can make a backup of your data without backing up your install and vis-versa. Another bonus - even if you trash your install to the point of wiping the partition and re-installing, all your data is safe.

        Please Read Me

        Comment


          #5
          Re: Can't access home directory with Live CD

          Thanks for your very comprehensive response - much appreciated

          To answer your main points:

          Partitions are not encrypted. Both have separate home partitions - the netbook's is on the left hand SD Card.

          My wife's netbook only ever leaves the house when we are on holiday. My laptop does from time to time and I have disabled auto-login.

          Groups - The home directory is user root and group root, whereas the ian folder is user ian and group ian. I suspect that that is why using the live CD (presumably as root) I can open the home folder and see the ian folder but not open it. On the netbook my wife has permission to create and delete files but IIRC she is a member of the group root, which does have access.

          I think that the primary concern was would I be able to rescue the data in the event of disaster. You have answered that, thanks. Like most people on the planet, I don't back up as often as I should, and sods law says that something will go wrong just as I am getting the USB hard drive out. I imagine my main issue would be as you say permissions, which reminds me of when I used to back up the data to DVD - I always forgot to tell K3b to keep permissions

          Anyway, thanks for the help - it's all much clearer now.

          Ian

          Comment


            #6
            Re: Can't access home directory with Live CD

            Originally posted by The Liquidator

            I load a live CD I can see my home directory but when clicking on the directory icon I get the message about not having permission. This kind of defeats the object of having a live CD as a rescue medium.
            To manipulata data on your hard drive, from a booted Live CD, you'll have to mount the partition where the data are located.


            To do that, open a terminal window and:

            Code:
            sudo mkdir /mnt/foo
            Code:
            sudo mount -t ext4 /dev/sdxx /mnt/foo
            assuming of course that the filesystem on the partition of interest is ext4, where "sdxx" is the drive and partition number of the partition that you need to mount, for example "sda2" for the second partiton on the first hard drive.

            Having done this, you can copy or alter the files in whatever manner you wish.

            Comment


              #7
              Re: Can't access home directory with Live CD

              dibl: Although your post is correct - the OP stated he was having a permission error, which he would likely get regardless of whether or not the partition was mounted. In the case his home partition was not mounted - attempting to access the /home directory would result in an empty folder. Of course - if it was mounted in a way that denied access for some reason, that's a different story.

              Liquidator: The livecd follows the (K)Ubuntu standard of not allowing GUI log in as root user.

              Just to be sure I booted it up this morning. The default behavior of the Kubuntu livecd is to auto log you in as user ubuntu and group ubuntu but both UID and GID are 999. I was able with a few clicks to open System Settings, go to User Management, create a new user with the UIG:GID of 1000. It would be easy enough for you to note the numerical UID:GID of all your user accounts and simply create a parallel user account after booting to the livecd, thus avoiding all the permission issues.

              If you really want a fun project: Create your own bootable "rescue" cd with all your user accounts pre-created and any backup utilities you might need on it. Sounds like a long weekend at the keyboard!



              Please Read Me

              Comment


                #8
                Re: Can't access home directory with Live CD

                I have UNR 9.10 USB key which exhibits the same behaviour. I created a new user that automatically had the ID 1000, logged out and logged in as the new user and Bingo! it worked! I was able to access the files.

                So, so, simple. Thanks a lot

                Comment

                Working...
                X