Find the answer to your Linux question:
Results 1 to 4 of 4
I have two problems, they may be related. I only have these problems as a non-root user. The problems I'm having are 1) I do not have permissions to create/modify ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    eap
    eap is offline
    Just Joined!
    Join Date
    Jul 2009
    Posts
    4

    Permissions problem?


    I have two problems, they may be related. I only have these problems as a non-root user. The problems I'm having are 1) I do not have permissions to create/modify files on the Desktop and 2) certain commands are not usable unless you are specifially logged in as root.

    For the first problem I was thinking since I had created a separate partition for /home that I would have to give myself permission by modifying /etc/fstab. It didn't work. Any ideas?

    The second one I find more bizarre. I can't run commands such as iwconfig, or shutdown. I get a "command not found". It's kinda annoying when I have to log out and log in as root just to properly shutdown my computer.

    ---
    Update:

    Checked again and it seems I can write files onto /home/nameOfUser but not /home/nameOfUser/Desktop. I guess I do have permissions to modify on that partition, just not on the Desktop. Still haven't fixed it yet.

  2. #2
    Linux Engineer Freston's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    1,049
    Commands such as shutdown and ifconfig are located in /sbin, which is by default not in a users path, but it is in the path of root. That is because the executables that affect the system are in /sbin, and regular users shouldn't run these.
    You can change this, as I did, by putting /sbin in your users path. You will then get a 'permission denied' rather than a 'command not found', which I prefer. Edit (as root) your /etc/profile or (as user) ~/.bashrc

    But you don't really have to log out/log in as root to run these commands, you can `su` to root, do your thing and `exit` back to being user.


    You can check permissions on files and directories with `ls -l`, you shouldn't have to change fstab to set permissions on your home dir. You can change permissions with `chmod` and you can change ownership with `chown`. Read the man pages for details.

    When you use `chmod`, this list can come in handy:
    Code:
    0=no permission
    1=x
    2=w
    3=wx
    4=r
    5=rx
    6=rw
    7=rwx
    Changing a permission on your Desktop dir would look like this;
    Code:
    chmod 700 ~/Desktop
    Also, I don't want to sound like I am RTFM'ing you, but the Slackbook has lots of good info and tips.
    Can't tell an OS by it's GUI

  3. #3
    kea
    kea is offline
    Just Joined!
    Join Date
    Jul 2009
    Location
    Hungary, Europe
    Posts
    9
    ...and don't forget to see if you are the owner of your Desktop directory.

    cd
    ls -ld Desktop

    and see the owner's username in the third column.

    ▄dvrivalgßssal:
    KEA.

  4. #4
    Just Joined! chigurh's Avatar
    Join Date
    Jul 2009
    Posts
    24
    I've always written it chmod 0xxx file
    mainly because since I've been reading about it almost everything I can think of that I've read has used it this way in examples or instructions. Just a habit.
    1xxx is sticky bit, which I hadn't used personally until I was tinkering with Linux From Scratch. I didn't finish it, but I had no problems up until the time I quit ... I was gonna hold off for a while ...

    Also, according to the Filesystem Hierachy Standard 2.3:
    /sbin : System binaries
    Purpose

    Utilities used for system administration (and other root-only commands) are stored in /sbin, /usr/sbin, and /usr/local/sbin. /sbin contains binaries essential for booting, restoring, recovering, and/or repairing the system in addition to the binaries in /bin. Programs executed after /usr is known to be mounted (when there are no problems) are generally placed into /usr/sbin. Locally-installed system administration programs should be placed into /usr/local/sbin.

Posting Permissions

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