Changing permissions of ps command

Ask a Question related to Sun Solaris, Design and Development.

  1. #1

    Default Changing permissions of ps command

    Hi All,
    I have a problem here, i had tried to change the prmissions of command
    ps to 777 from 555. But the permissions of few other files are getting
    changed. I had noticed that all these files are hard links and their
    inode is same. Probably because of this it is creating the problem.
    But, the output of each program is different.
    Anyways, how do i set permission for only this files. Your suggestions
    will be highly Appreciated.
    Regards,
    Kishore.
    Kishore Guest

  2. Similar Questions and Discussions

    1. Changing 'Read Only' permissions....
      Hi i think i need to somehow change the read only permission with flash 9...is there a way to do this?
    2. Contribute permissions vs. network permissions
      We are currently implementing Contribute in a website that is highly centralized, with approximately 50 department-level CT writers and 4 CT...
    3. Changing NTFS permissions in ASP.NET
      Hi. Some related questions were discussed here, but my question is some different. I'm writing the project, the metter of it can be expressed...
    4. changing the default folder for the "open file" command
      Is there any way to change the default folder that opens on the "open file" command - to a folder other than "My Documents"? I am using XP...
    5. Changing folder permissions remotely
      Hi, can anyone tell me how to change the folder permissions (win2k , winxp) remotely ? can it be done with a script / batch file ? appreciate if...
  3. #2

    Default Re: Changing permissions of ps command



    Kishore wrote:
    >
    > Hi All,
    > I have a problem here, i had tried to change the prmissions of command
    > ps to 777 from 555. But the permissions of few other files are getting
    > changed. I had noticed that all these files are hard links and their
    > inode is same. Probably because of this it is creating the problem.
    > But, the output of each program is different.
    > Anyways, how do i set permission for only this files. Your suggestions
    > will be highly Appreciated.
    Go back a stage, and tell us what you are trying to achieve, and why you
    think adding write permissions to ps for all users will help.

    John Howells
    John Howells Guest

  4. #3

    Default Re: Changing permissions of ps command

    Please bare in mind that ps uses setuid bit.. for having root acces
    Watch out with changing that..





    "Kishore" <vkkumar@indiatimes.com> wrote in message
    news:7d34fc3.0307232318.2d0da27f@posting.google.co m...
    > Hi All,
    > I have a problem here, i had tried to change the prmissions of command
    > ps to 777 from 555. But the permissions of few other files are getting
    > changed. I had noticed that all these files are hard links and their
    > inode is same. Probably because of this it is creating the problem.
    > But, the output of each program is different.
    > Anyways, how do i set permission for only this files. Your suggestions
    > will be highly Appreciated.
    > Regards,
    > Kishore.

    Nobody Guest

  5. #4

    Default Re: Changing permissions of ps command

    "Nobody" <nobody@nix.nl> writes:
    > Please bare in mind that ps uses setuid bit.. for having root acces
    > Watch out with changing that..
    /usr/ucb/ps does that (behind a wrapper) for access to environment
    variables, but since /proc was integrated into Solaris, regular
    /usr/bin/ps doesn't need to be setuid.

    --
    James Carlson, Solaris Networking <james.d.carlson@sun.com>
    Sun Microsystems / 1 Network Drive 71.234W Vox +1 781 442 2084
    MS UBUR02-212 / Burlington MA 01803-2757 42.497N Fax +1 781 442 1677
    James Carlson Guest

  6. #5

    Default Re: Changing permissions of ps command

    [email]vkkumar@indiatimes.com[/email] (Kishore) writes:
    > I have a problem here, i had tried to change the prmissions of command
    > ps to 777 from 555.
    Uh ... why? Why would you want all users on your system to be able to
    write to this file? That seems like a really bad thing to do.
    > But the permissions of few other files are getting
    > changed. I had noticed that all these files are hard links and their
    > inode is same. Probably because of this it is creating the problem.
    > But, the output of each program is different.
    It's a bit of magic. ;-}

    They're all hard links to 'isaexec' which looks at the kernel
    architecture and runs `isainfo -k`/argv[0] -- so what really gets run
    on a 64 bit kernel is /usr/bin/sparcv9/ps.

    --
    James Carlson, Solaris Networking <james.d.carlson@sun.com>
    Sun Microsystems / 1 Network Drive 71.234W Vox +1 781 442 2084
    MS UBUR02-212 / Burlington MA 01803-2757 42.497N Fax +1 781 442 1677
    James Carlson Guest

  7. #6

    Default Re: Changing permissions of ps command

    Hi,
    The system recognise different command (ps ,w ... there is 32 command or
    more...)
    by the name of the command and her directory.
    To attribute permissions only to PS command who can copy this command and
    after you
    change permissions.
    # rm ps
    # cp w ps
    # chmod 555 ps

    bye...

    "Kishore" <vkkumar@indiatimes.com> a écrit dans le message de news:
    [email]7d34fc3.0307232318.2d0da27f@posting.google.com[/email]...
    > Hi All,
    > I have a problem here, i had tried to change the prmissions of command
    > ps to 777 from 555. But the permissions of few other files are getting
    > changed. I had noticed that all these files are hard links and their
    > inode is same. Probably because of this it is creating the problem.
    > But, the output of each program is different.
    > Anyways, how do i set permission for only this files. Your suggestions
    > will be highly Appreciated.
    > Regards,
    > Kishore.

    ragnus2003 Guest

  8. #7

    Default Re: Changing permissions of ps command

    Hello All,

    Thanks for your responses, It was just a coincidense i had mentioned
    it as 777 for that sense it could be 550 also.
    Anyways, i did a work arround for this. i.e.,
    copied the file to some other file and moved back to orginal file name
    ( Then its inode number got changed, hence iam able to change the
    permissions).
    Do anybody anticipate any problem by doing like this.

    Regards,
    Kishore
    Kishore Guest

  9. #8

    Default Re: Changing permissions of ps command

    Kishore wrote:
    > Hello All,
    >
    > Thanks for your responses, It was just a coincidense i had mentioned
    > it as 777 for that sense it could be 550 also.
    > Anyways, i did a work arround for this. i.e.,
    > copied the file to some other file and moved back to orginal file name
    > ( Then its inode number got changed, hence iam able to change the
    > permissions).
    > Do anybody anticipate any problem by doing like this.
    >
    (slaps forehead) I was afraid he was going to have this flash of genius...

    *Yes*, this is a problem. Rearranging basic system components at
    random like this is *never* a good idea. Among other problems,
    you have ensured that any attempts to patch or upgrade this part
    of the system will break.

    You have yet to explain *why* you want to change the permissions of
    ps but not the permissions of the things hard-linked to it. Generally,
    messing about like this in /usr/bin/ is bad idea unless you a) know
    what you're doing and b) have a specific reason *why* you want to do
    it.

    Chris Mattern

    Chris Mattern Guest

  10. #9

    Default Re: Changing permissions of ps command

    ragnus2003 wrote:
    > Hi,
    > The system recognise different command (ps ,w ... there is 32 command or
    > more...)
    > by the name of the command and her directory.
    > To attribute permissions only to PS command who can copy this command and
    > after you
    > change permissions.
    > # rm ps
    > # cp w ps
    > # chmod 555 ps
    >
    ragnus, this is a really *bad* idea. Rearranging /usr/bin/ at random like this
    makes patchadd cry.

    Chris Mattern

    Chris Mattern Guest

  11. #10

    Default Re: Changing permissions of ps command

    In article <3F219323.3090306@gwu.edu>, Chris Mattern <syscjm@gwu.edu> wrote:
    >You have yet to explain *why* you want to change the permissions of
    >ps but not the permissions of the things hard-linked to it. Generally,
    >messing about like this in /usr/bin/ is bad idea unless you a) know
    >what you're doing and b) have a specific reason *why* you want to do
    >it.
    My guess is that he's trying to address the problem of sensitive data in
    command line arguments, which other users can see with ps. So he's
    restricting access to ps.

    But since the *real* ps is the architecture-specific one that this
    dispatches to, that's the program whose permissions he should be changing.

    In general, if a program doesn't have setuid permission, removing access to
    it won't solve a security issue like this, since anything it can do can be
    done by a user-written program or script.

    --
    Barry Margolin, [email]barry.margolin@level3.com[/email]
    Level(3), Woburn, MA
    *** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
    Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
    Barry Margolin Guest

  12. #11

    Default Re: Changing permissions of ps command

    In article <HQgUa.406$0z4.71@news.level3.com>,
    Barry Margolin <barry.margolin@level3.com> wrote:
    [...]
    >My guess is that he's trying to address the problem of sensitive data in
    >command line arguments, which other users can see with ps. So he's
    >restricting access to ps.
    He is attempting to *restrict* access by changing the permissions to 777?
    If so, I think he is in serious need of a Unix 101 remedial course ...

    Chris Thompson
    Email: cet1 [at] cam.ac.uk
    Chris Thompson Guest

  13. #12

    Default Re: Changing permissions of ps command

    Yes i'ts true....
    But what is the solution for this problem ???
    if you set up permission to on comand and not hard links ???

    Vince
    "Chris Mattern" <syscjm@gwu.edu> a écrit dans le message de news:
    [email]3F2193A4.6020108@gwu.edu[/email]...
    > ragnus2003 wrote:
    > > Hi,
    > > The system recognise different command (ps ,w ... there is 32 command or
    > > more...)
    > > by the name of the command and her directory.
    > > To attribute permissions only to PS command who can copy this command
    and
    > > after you
    > > change permissions.
    > > # rm ps
    > > # cp w ps
    > > # chmod 555 ps
    > >
    > ragnus, this is a really *bad* idea. Rearranging /usr/bin/ at random like
    this
    > makes patchadd cry.
    >
    > Chris Mattern
    >

    ragnus2003 Guest

  14. #13

    Default Re: Changing permissions of ps command

    ragnus2003 wrote:
    > Yes i'ts true....
    > But what is the solution for this problem ???
    > if you set up permission to on comand and not hard links ???
    >
    The answer is step back and ask, "Why are you trying to do this?"
    The OP is (one hopes) not changing permissions for the sake of
    changing permissions, but is rather trying to accomplish something.
    Most likely, whatever he's trying to accomplish, trying to change
    permissions is the Wrong Way, and he should be using a different
    approach. Unfortunately, we've been unable to pry out of him
    exactly what he's *really* trying to do.

    Chris Mattern

    Chris Mattern Guest

  15. #14

    Default Re: Changing permissions of ps command

    In article <3f2319e9$0$21133$626a54ce@news.free.fr>,
    ragnus2003 <vincent.ragueneau@fnac.net> wrote:
    >Yes i'ts true....
    >But what is the solution for this problem ???
    >if you set up permission to on comand and not hard links ???

    It would be better to change the permissions on /usr/bin/sparcv*/ps
    and leave /usr/bin/ps as a hard link to the wrapper program. That is
    less likely to break patchadd.
    >
    >Vince
    >"Chris Mattern" <syscjm@gwu.edu> a écrit dans le message de news:
    >3F2193A4.6020108@gwu.edu...
    >> ragnus2003 wrote:
    >> > Hi,
    >> > The system recognise different command (ps ,w ... there is 32 command or
    >> > more...)
    >> > by the name of the command and her directory.
    >> > To attribute permissions only to PS command who can copy this command
    >and
    >> > after you
    >> > change permissions.
    >> > # rm ps
    >> > # cp w ps
    >> > # chmod 555 ps
    >> >
    >> ragnus, this is a really *bad* idea. Rearranging /usr/bin/ at random like
    >this
    >> makes patchadd cry.
    >>
    >> Chris Mattern
    --
    Tom Schulz
    [email]schulz@adi.com[/email]
    Thomas Schulz Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139