Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Giving user or application permissions.

  1. #1
    Join Date
    Apr 2012
    Posts
    42

    Default Giving user or application permissions.

    Hi

    Im new on openSUSE so bear with me!

    After successfully installing and starting XAMPP Im a bit stumped now. Im using geany for PHP and want to be able to save my files directly into:

    /opt/lampp/htdocs

    but I dont have the permissions on my user so Ive been using su to move them using the terminal which is a pain since geany then cant find the files!

    How can I grant these permissions to my user?

    Cheers

  2. #2
    Join Date
    May 2011
    Location
    here
    Posts
    180

    Default Re: Giving user or application permissions.

    Quote Originally Posted by lkzp View Post
    Hi

    Im new on openSUSE so bear with me!

    After successfully installing and starting XAMPP Im a bit stumped now. Im using geany for PHP and want to be able to save my files directly into:

    /opt/lampp/htdocs

    but I dont have the permissions on my user so Ive been using su to move them using the terminal which is a pain since geany then cant find the files!

    How can I grant these permissions to my user?

    Cheers
    edit sudoers file, adding yourself copy-past permissions
    that should solve it...

  3. #3
    Join Date
    Sep 2008
    Location
    Earl Shilton UK
    Posts
    298

    Default Re: Giving user or application permissions.

    Or, add your user to the group which owns /opt/lampp/htdocs. Eg:

    Code:
    ls -las /opt/lampp/
    htdocs drwxrwxr-- root www-data
    root is the owner, www-data is the group.
    root has permissions rwx (read,write,execute)
    www-data has rwx also
    other (anyone else) has r-- (read, no write, no execute)
    Ignore the 'd' - it means directory

    Assuming that the group www-data has write permissions, add your user to the www-data group. To see your groups, do this:
    Code:
    id user
    Replace user with your user name.

    To add your user to a group do this
    Code:
    gpasswd -a user group
    Replace user and group with the appropriate user & group names
    Happily using Linux since 1998
    Share & Enjoy

  4. #4
    Join Date
    Apr 2012
    Posts
    42

    Default Re: Giving user or application permissions.

    Quote Originally Posted by weighty_foe View Post
    Or, add your user to the group which owns /opt/lampp/htdocs. Eg:

    Code:
    ls -las /opt/lampp/
    htdocs drwxrwxr-- root www-data
    root is the owner, www-data is the group.
    root has permissions rwx (read,write,execute)
    www-data has rwx also
    other (anyone else) has r-- (read, no write, no execute)
    Ignore the 'd' - it means directory

    Assuming that the group www-data has write permissions, add your user to the www-data group. To see your groups, do this:
    Code:
    id user
    Replace user with your user name.

    To add your user to a group do this
    Code:
    gpasswd -a user group
    Replace user and group with the appropriate user & group names


    Ok I ran ls with this result.

    # ls -las /opt/lampp
    total 168
    4 drwxr-xr-x 18 root root 4096 May 25 12:03 .
    4 drwxr-xr-x 3 root root 4096 May 25 11:36 ..
    12 drwxr-xr-x 2 root root 12288 Sep 19 2011 bin
    4 drwxr-xr-x 2 root root 4096 Jul 14 2004 cgi-bin
    4 drwxr-xr-x 3 root root 4096 Apr 13 2009 error
    4 drwxr-xr-x 8 root root 4096 Sep 19 2011 etc
    4 drwxr-xr-x 4 nobody root 4096 May 25 12:14 htdocs
    4 drwxr-xr-x 3 root root 4096 May 31 2003 icons
    16 -rwxr-xr-x 1 root root 15325 Sep 2 2011 lampp
    12 drwxr-xr-x 15 root root 12288 Sep 19 2011 lib
    4 drwxr-xr-x 2 root root 4096 Apr 26 2006 libexec
    4 drwxr-xr-x 36 root root 4096 Aug 24 2009 licenses
    4 drwxr-xr-x 2 root root 4096 May 25 11:38 logs
    4 drwxr-xr-x 2 root root 4096 Sep 19 2011 modules
    4 drwxr-xr-x 10 root root 4096 Sep 16 2011 phpmyadmin
    64 -rw-rw-r-- 1 root root 65212 Sep 19 2011 RELEASENOTES
    4 drwxr-xr-x 2 root root 4096 Sep 19 2011 sbin
    4 drwxr-xr-x 39 root root 4096 Sep 19 2011 share
    4 drwxr-xr-x 3 root root 4096 Jan 18 2005 tmp
    4 drwxr-xr-x 6 root root 4096 May 25 11:38 var

    Which is the group and which is the owner?

    Cheers

  5. #5
    Join Date
    Apr 2012
    Posts
    42

    Default Re: Giving user or application permissions.

    Quote Originally Posted by weighty_foe View Post
    Or, add your user to the group which owns /opt/lampp/htdocs. Eg:

    Code:
    ls -las /opt/lampp/
    htdocs drwxrwxr-- root www-data
    root is the owner, www-data is the group.
    root has permissions rwx (read,write,execute)
    www-data has rwx also
    other (anyone else) has r-- (read, no write, no execute)
    Ignore the 'd' - it means directory

    Assuming that the group www-data has write permissions, add your user to the www-data group. To see your groups, do this:
    Code:
    id user
    Replace user with your user name.

    To add your user to a group do this
    Code:
    gpasswd -a user group
    Replace user and group with the appropriate user & group names
    Ok cheers, I understand now.

    Only thing is "nobody" is the owner and root is the group. It would be bad practice to add my user to the root group would it not? How would I change the owner of /opt/lampp/?

    ...Linux has a steep learning curve!

  6. #6
    Join Date
    May 2011
    Location
    here
    Posts
    180

    Default Re: Giving user or application permissions.

    Quote Originally Posted by lkzp View Post
    It would be bad practice to add my user to the root group would it not?
    yes thats not the best idea


    Quote Originally Posted by lkzp View Post
    How would I change the owner of /opt/lampp/?
    you can recursively change the owner for all files and folders inside that directory to you as another user . Lets set the owner of the files and folders to “lkzp"
    chown -R lkzp *


    OR
    using visudo command as ROOT user navigate to :
    # User privilege specification
    and add yourself example:
    lkzp ALL = NOPASSWD: /sbin/copy,


    that will give you rights to copy files within all directories.....

  7. #7
    Join Date
    Apr 2012
    Posts
    42

    Default Re: Giving user or application permissions.

    Done!

    Thanks for the help.

  8. #8
    Join Date
    Mar 2009
    Location
    sri mayapur, west bengal, india
    Posts
    958

    Default Re: Giving user or application permissions.

    On Wed, 25 Apr 2012 22:06:03 +0530, lkzp <lkzp@no-mx.forums.opensuse.org>
    wrote:

    >
    > Done!
    >
    > Thanks for the help.
    >


    i'm glad you got your problem solved and hope things will keep working for
    you.

    but for the benefit of others who may arrive at this thread via forum or
    google search, i'd like to add that this is not the generally prefered way
    to install apache, PHP, and MySQL on openSUSE.

    unlike under windows, web and database services are an integrated part of
    most or even all linux operating systems, and you do not have to install
    them from a separate source like XAMPP.

    in your standard repositories you find the apache web server, PHP, and
    MySQL database server & client. if installed from these repos, they'll get
    updated automatically when security patches become available (via the
    update repo), and there are special repos available that provide newer
    versions of these services if desired. this sometimes leads to
    difficulties, per example when you want to install a particular version of
    apache or PHP which are not part of the openSUSE repos anymore. in this
    case it may be useful to use an external source like XAMPP.

    installing web services via openSUSE repos also gives you access to YAST
    configuration tools that make it easier to configure these services --
    even though i always find it easier to edit the services' configuration
    files, since i'm used to this approach from long ago.

    in general i wouldn't recommend to install apache/PHP/MySQL via XAMPP, but
    from the standard openSUSE repos. in your case, since you got your
    installation working it appears, you should probably continue the way
    you're going, until or unless you meet problems on the way.

    instructions on how to install & configure web services in openSUSE are
    available in these forums, but i must admit i'm too lazy to go looking for
    them now...

    --
    phani.

  9. #9
    Join Date
    May 2011
    Location
    here
    Posts
    180

    Default Re: Giving user or application permissions.

    Quote Originally Posted by lkzp View Post
    Done!

    Thanks for the help.
    Good to hear that!

    Good Luck lkzp

  10. #10
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: Giving user or application permissions.

    On 2012-04-25 16:56, lkzp wrote:

    > Which is the group and which is the owner?


    Code:
    owner    group
    /       /
    > 4 drwxr-xr-x  6 root   root  4096 May 25 11:38 var
    |      ---
    |   ---   \ "other" users permissions.
    |---   \ group permissions
    |   \ owner permissions
    \ type of file

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.4 x86_64 "Celadon" at Telcontar)

Page 1 of 2 12 LastLast

Posting Permissions

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