Results 1 to 3 of 3

Thread: Accessing restrected files

  1. #1
    Join Date
    Dec 2008
    Location
    Phoenix, Arizona
    Beans
    105
    Distro
    Ubuntu 12.04 Precise Pangolin

    Accessing restrected files

    So, some background.

    I created a second user and named it guest. gave it no password by doing a little trick i read about.

    Anyway... that all went dandy, however out of courisoity, i was trying to see what i could do in the guest account.

    So i restrected access to /home/guest via the guest account (right clicked the file and made it where only guest could access it)

    Then i went to my main account, and was trying to see how to use my admistrative abilitys

    I went to the file and double clicked it... access restrected. (ok... well at least this will be fun)

    Terminal ->
    Code:
    CD /home/guest
    Permission denied.
    Ok... well i know how to fix that

    Code:
    sudo cd /home/guest
    sudo: cd: command not found
    Well now im stuck... How does the administrator access restrected files? (I mean i could always log back into guest and unrestrect them, but thats no fun)

  2. #2
    Join Date
    Aug 2006
    Location
    Ingelmunster, Belgium
    Beans
    29

    Re: Accessing restrected files

    The command 'sudo cd /home/guest' won't work because 'cd' isn't a command, it's a builtin command of Bash, the shell.

    To get around to this you should do 'sudo -i' to become root and then 'cd /home/guest'. Just don't forget to do 'exit' after you are done doing whatever you do to become a regular user again.

    If you don't want to become root you always do 'sudo ls /home/guest' to take a peek inside the directory.
    www.sinax.be
    Open Source Integrators, consulting and custom development

  3. #3
    Join Date
    Apr 2006
    Location
    Montana
    Beans
    Hidden!
    Distro
    Kubuntu Development Release

    Re: Accessing restrected files

    use
    Code:
    sudo bash -c "builtin cd /"
    Note this will not do much of anything as bash will cd , then exit.

    You can see it works if you execute a command

    [quote]~$ sudo bash -c "builtin cd / ; ls "
    bin dev initrd.img lib32 media proc selinux tmp vmlinuz
    boot etc initrd.img.old lib64 mnt root srv usr vmlinuz.old
    cdrom home lib lost+found opt sbin sys var

    ~$[/code]

    Which of course can be accomplished with

    Code:
    sudo ls /
    Most likely you so not need to sudo cd ...
    There are two mistakes one can make along the road to truth...not going all the way, and not starting.
    --Prince Gautama Siddharta

    #ubuntuforums web interface

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •