Permission Denied - How to surpass this issue?

Discussion in 'FOG Problems' started by CASEY, Mar 6, 2012.

  1. CASEY New Member

    Hello,

    Excuse me if I am posting on an already said topic. I am new to these forums as of 2 minutes ago and could not find anything relative to my issue. I am running Ubuntu 10.04 LTS with the latest version of FOG and the latest Kernel as of this very moment.

    My issue is this:

    When I want to make a change, to say config.php located at /var/www/fog/commons, I am required to make the change via terminal with the gksu gedit command. If and when I try to access the file to edit, I am blocked due to permissions. In some cases I cannot even do this because I am blocked from the folder entirely.

    I have re-installed FOG about 5 times due to messing things up :p I have done chmod 777 on the directories before but I believe it messed things up (though I don't remember). I have changed the fog user password on the Ubuntu OS using 'sudo passwd fog' command. but that REALLY messed things up.

    I was wondering if there was an easier way around this? I see forums posts about people editing config.php or MultiTask.class.php (both of which Id like to configure) without ever stating how they do it.

    My main purpose is to try and make sure I am running in Full Duplex mode but also have control of these files for editing.

    Any help would be great!

    Thanks,
    CASEY
  2. Zardan Member

    I have always used "sudo nano -w /var/www/fog/commons/config.php" to edit files without any permission issues.
  3. CASEY New Member

    Right on! Thanks Zardan!

    That does work however, with this being said, how can I view the contents of a folder with sudo privileges? This command is kind of useless if I don't know what's in the directories! Lol
  4. joshua Member

    Sudo -- means superuser 'DO'. As in "run as administrator".

    not sure what you mean by "command is useless if I don't know whats in directories".

    try the ls command. (as in list)

    You must be new to linux commands.. Take things one step at a time and you will be familiar in no time.

    VI - a really basic text editor.

    How to edit text?

    use arrow keys to move up,down,left,right..
    when you get to where you want to make a change, press the insert key on the keyboard. this will put you in INSERT mode. This will allow you to delete, backspace and change text to your desire.

    When you are all done, just press escape. This will escape INSERT mode.
    You can move the cursor somewhere else now and edit it (by hitting INSERT again).

    All done? well to save your file you need to NOT be in insert mode, and press : (yes a colon. so you will have to hold shift and press the : key)

    now you will see the colon appear at the bottom of your screen.
    :

    now what? Type in one of the following to perform an action.
    w = write
    q = quit
    ! = force

    so to save and exit you have to type this

    :wq!

    Hope this proves useful.

    EDIT: from Zardans suggestion -- Nano is for GUI.. which is not always available. VI is always available.
  5. CASEY New Member

    ls allows me to see the contents. Thank you! Exactly what i was looking for :) lol

    Scratch that! I am getting an access denied message. How do I see the contents of these FOG owned folders?
  6. joshua Member

    try ls -al it will show all details and hidden files
  7. falko Community Manager

    install webmin on your Ubuntu Server

Share This Page