Folder permissions in Ubuntu

Discussion in 'Open Source' started by djmykey, Sep 2, 2006.

Thread Status:
Not open for further replies.
  1. djmykey

    djmykey Let the music play.....

    Joined:
    Dec 14, 2003
    Messages:
    665
    Likes Received:
    2
    Trophy Points:
    0
    Location:
    Pune
    Ok, so guys I did install Ubuntu 6.06 atlast. So now I have some problems. (No no not some dependencies problem, thank synaptic)

    I have mounted my windows hard drives, i.e. all the hdd's that are partitioned as NTFS, by editing the fstab file. Now does the problem start. I edited the fstab file thru some sudo command given on the unofficial Ubuntu guide.

    So now what happens is the partitions do get mounted but I cant access them coz I dont have the rights to do so. Ok so I'm not so dumb and hence tried to check them out and then I find out that those folders were created by root. (what they were created by me.)

    So then I go figure out u can't login as root into the console (duh was this necessary)
    so I find out a workaround and then login as root and then I find out that still I cant change the permissions (hey this was unexpected)

    So I want to know how can I access them through my djmykey login, I dun wanna login as root eveytime.

    Contents of /etc/fstab file
    Code:
    # /etc/fstab: static file system information.
    #
    # <file system> <mount point>   <type>  <options>       <dump>  <pass>
    proc            /proc           proc    defaults        0       0
    /dev/hda1       /               ext3    defaults,errors=remount-ro 0       1
    /dev/hda2       none            swap    sw              0       0
    /dev/hdb1       /home/djmykey/Songz     ntfs    user,ro,auto    0       0
    /dev/hdc5       /home/djmykey/Toolz     ntfs    user,ro,auto    0       0
    /dev/hdd1       /home/djmykey/MnP       ntfs    user,ro,auto    0       0
    /dev/hdd5       /home/djmykey/Gamez     ntfs    user,ro,auto    0       0
    
     
  2. Sykora

    Sykora I see right through you.

    Joined:
    Sep 10, 2005
    Messages:
    597
    Likes Received:
    4
    Trophy Points:
    0
    Location:
    Chennai
    To execute a command as root user from your own user account, prefix "sudo" to all your commands eg "sudo vim fstab" (or whatever editor you use).
    The change that needs to be made to your fstab is this :
    In the column where you have user,ro,auto , add the key "umask=022" . This gives permissions to the ntfs partitions.
     
  3. OP
    OP
    djmykey

    djmykey Let the music play.....

    Joined:
    Dec 14, 2003
    Messages:
    665
    Likes Received:
    2
    Trophy Points:
    0
    Location:
    Pune
    U dint get it. I edited the fstab using sudo. But I dont have permissions to the folders or the mount points I have created where the hdd gets mounted. i.e. /home/djmykey/Songz. So just help me figure out that.
     
  4. mehulved

    mehulved 18 Till I Die............

    Joined:
    Jul 15, 2004
    Messages:
    5,790
    Likes Received:
    44
    Trophy Points:
    0
    Location:
    India, Mumbai, Marine Lines
    mikey rather mount them in /media/ or /mnt/ partition, That will help to show them in Places menu.
    Do you mean you want to mount them manually without using mount command as sudo? eg.
    Code:
    sudo mount /dev/hdc5 /home/mikey/Gamez
    Also, give
    Code:
     sudo mount -a
    command and see if things work fine now?
    If you cannot access the folders within the partitions then follow what Sykora said.
     
  5. JGuru

    JGuru Well-Known Member

    Joined:
    Dec 25, 2005
    Messages:
    1,705
    Likes Received:
    32
    Trophy Points:
    48
    Location:
    Space-time continuum
    @djmykey, You should mount the Windows partitions in the '/media' directory or '/mnt'
    directory.
    Open the Terminal Window & login as root:
    $ su -
    (Enter password)
    # cd /home
    # chmod -R 777 /djmykey
    # exit

    In case you have not created a root password, here's how:
    $ sudo passwd root
    (Enter Password)
    (Enter password)
    Remember password not echoed!!Not even '*' is echoed!!
    This should solve your problem.
     
  6. mehulved

    mehulved 18 Till I Die............

    Joined:
    Jul 15, 2004
    Messages:
    5,790
    Likes Received:
    44
    Trophy Points:
    0
    Location:
    India, Mumbai, Marine Lines
    No don't create a root password. That's a big no-no. This entices people to use root account, which is not a good practise. If you want root access to a shell rather use
    Code:
    sudo -s -H
    So, su is also out of question.
     
  7. JGuru

    JGuru Well-Known Member

    Joined:
    Dec 25, 2005
    Messages:
    1,705
    Likes Received:
    32
    Trophy Points:
    48
    Location:
    Space-time continuum
    You are right @Tech_your_future. I have seen lot of people misuse the 'root' priviledges!!
    Yeah, better use 'sudo'

    type:
    $ sudo -s -H nautilus
     
  8. OP
    OP
    djmykey

    djmykey Let the music play.....

    Joined:
    Dec 14, 2003
    Messages:
    665
    Likes Received:
    2
    Trophy Points:
    0
    Location:
    Pune
    Guys guys thanks for all the suggestions but I'm cool with the mount points and all. The thing is I edited the fstab file with the sudo command and hence I cant access the mountpoint folders itself. If I could access those folders I can access the files in it as well so anything to help me with that.

    Am attaching a screenshot of the permissions to help u ppl ring any bells.
    [​IMG]
     
  9. ~Phenom~

    ~Phenom~ The No.1 Stupid

    Joined:
    May 17, 2005
    Messages:
    1,703
    Likes Received:
    5
    Trophy Points:
    0
    Location:
    CYBERYARD
    hey guys , a friend of mine yesterday reset the root password of many computers of our college , while he was logged in with another user. How is it done??? our linux teacher was completely impressed by him, may i know the trick???
    The linux was Red Hat 9.
     
  10. Pathik

    Pathik Google Bot

    Joined:
    Aug 28, 2005
    Messages:
    9,747
    Likes Received:
    20
    Trophy Points:
    0
    hey dats not possible.... btw my teacher wd hav kicked me out of d class.. :))
     
  11. santu_29

    santu_29 New Member

    Joined:
    Jun 21, 2005
    Messages:
    232
    Likes Received:
    1
    Trophy Points:
    0
    Location:
    Delhi
    u can do that by using passwd command via telnet, however you need to be logged in as root(su).
     
  12. OP
    OP
    djmykey

    djmykey Let the music play.....

    Joined:
    Dec 14, 2003
    Messages:
    665
    Likes Received:
    2
    Trophy Points:
    0
    Location:
    Pune
    Ok guys u ppl really deviated frm the subject but I found the error that I made

    In the options after mentioning that the drive was an ntfs I used this

    user,ro,auto

    where I was supposed to use this

    nls=utf8,umask=0222

    that did it.

    @JGuru:- This was a scary command

    # chmod -R 777 /djmykey

    U wanted me to change the file permissions on each and everyfile cmon dont tell me man ur good at linux man.

    Anyways this topic is finished. This was created due to my laziness anyways so u ppl can lock it now.
     
  13. praka123

    praka123 left this forum longback

    Joined:
    Sep 7, 2005
    Messages:
    7,513
    Likes Received:
    24
    Trophy Points:
    0
    Location:
    -
    Code:
    [B]# chmod -R 744 /djmykey[/B]
    that will do
     
    Last edited: Sep 2, 2006
  14. mehulved

    mehulved 18 Till I Die............

    Joined:
    Jul 15, 2004
    Messages:
    5,790
    Likes Received:
    44
    Trophy Points:
    0
    Location:
    India, Mumbai, Marine Lines
    That will of course do prakash but won't it open up all the files in other partition to be read, written and executed by everyone?
     
  15. praka123

    praka123 left this forum longback

    Joined:
    Sep 7, 2005
    Messages:
    7,513
    Likes Received:
    24
    Trophy Points:
    0
    Location:
    -
    yup its wrong suddenly thought of executables ;)
    __________
    but again 755 is the default permission system wide afaik
     
    Last edited: Sep 2, 2006
  16. gary4gar

    gary4gar GaurishSharma.com

    Joined:
    May 21, 2005
    Messages:
    4,094
    Likes Received:
    24
    Trophy Points:
    0
    Location:
    Jaipur
    well there is a gui method of changing folder perimissions also.
    open nautilus as root and right click on folder and select the permissions tab. now change the permissions.
     
  17. mehulved

    mehulved 18 Till I Die............

    Joined:
    Jul 15, 2004
    Messages:
    5,790
    Likes Received:
    44
    Trophy Points:
    0
    Location:
    India, Mumbai, Marine Lines
    Not really needed in this case as mikey seems comfortable with CLI. And it's better to stick to CLI as the GUI method will change for different file managers, that's why people ask to stick to CLI. One CLI can have many frontends with some variations in method of operations but mostly CLI will only be done by one method and it's not at all difficult to remember such a small command.
    I am sure people used to remember all the commands in days of DOS.
     
  18. OP
    OP
    djmykey

    djmykey Let the music play.....

    Joined:
    Dec 14, 2003
    Messages:
    665
    Likes Received:
    2
    Trophy Points:
    0
    Location:
    Pune
    Guys guys guys enuff of this discussion. Dont u ppl get it. I already solved the problem. U know what is the problem with this forum ppl out here really think that they know something abt a certain problem (actually they do know a lot but...) and give some advice but the advice doesnt sound in the way it must and hence lot of ppl r misled and go groping around in the dark, So ppl no offence but this thread is over. And what the hell were u ppl discussing about. U know what go and mount a ntfs partition as I did in in the first hand and use the options I did using sudo and see what it does. Inspite of giving repeated posts that the GUI of the permissions r not working u ppl still insist that it shud b done in that way. Where r ur brains. I dint expect this from u senior ppl. U can fry me off this forum but I'm not at all impressed. I told u also that I cant get anything to do, I just cudnt touch the folder permissions coz the mounting itself was wrong and u ppl without checking the mounting options went on the rant abt permissions. Anyways my hands r paining coz of the typing I did yest so I end it here. And I had pm'ed a mod to close this thread. Maybe they dint recieve it or anything but pls any mod reading this pls do close this thread.
     
  19. mehulved

    mehulved 18 Till I Die............

    Joined:
    Jul 15, 2004
    Messages:
    5,790
    Likes Received:
    44
    Trophy Points:
    0
    Location:
    India, Mumbai, Marine Lines
    mikey the answer has been given by Sykora in the first reply itself. As far as I can see, the solution you got and sykora suggested are the same.
     
  20. Sykora

    Sykora I see right through you.

    Joined:
    Sep 10, 2005
    Messages:
    597
    Likes Received:
    4
    Trophy Points:
    0
    Location:
    Chennai
    Permissions for individual files are done after mounting, but permissions for the whole filesystem is done at the time of mount. You didn't tell linux how to mount your filesystem, so you couldn't touch anything.

    And here I was, thinking that my advice in my first reply was to-the-point. Ah well.
     
Thread Status:
Not open for further replies.

Share This Page