Results 1 to 5 of 5

Thread: how do I set the sticky bit?

  1. #1
    Join Date
    Nov 2008
    Location
    Maine
    Beans
    1,125
    Distro
    Ubuntu 10.04 Lucid Lynx

    Question how do I set the sticky bit?

    Hi All,
    I wrote some code that directly accesses hardware but I still get iopl errors. Ive been reading and I think setting the sticky-bit could be what I need to do to make my programs run correctly.

    So how do I set the sticky bit?
    ~Conradin~

  2. #2
    Join Date
    Apr 2010
    Location
    England
    Beans
    3,286

    Re: how do I set the sticky bit?

    Code:
    chmod +t /path/to/directory-or-directory
    http://xkcd.com/293/
    There are 10 kinds of people in this world: Those who understand ternary, those who don't, and those who confuse it with binary.

  3. #3
    Join Date
    Nov 2008
    Location
    Maine
    Beans
    1,125
    Distro
    Ubuntu 10.04 Lucid Lynx

    Question Re: how do I set the sticky bit?

    Thanks wormzy that does set the sticky bit,
    I think what Im actualy trying to do is set the psermissions to something like:
    -r-s--x--x
    have any idea how to do that?
    ~Conradin~

  4. #4
    Join Date
    Nov 2008
    Location
    Maine
    Beans
    1,125
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: how do I set the sticky bit?

    using stupid brute force, i figured it out with code
    Code:
    #!/bin/bash
    for i in `seq 0 7777`;
    do
    	chmod $i '/usr/students/elovejoy/Desktop/bj'
    	echo $i ":" `ls -l '/usr/students/j/Desktop/bj'` >> modes
    	echo
    done
    Then searched that output file for "-r-S--x--x"
    So i think
    Code:
    chmod 4411 <file>
    will work.
    ~Conradin~

  5. #5
    Join Date
    Apr 2010
    Location
    England
    Beans
    3,286

    Re: how do I set the sticky bit?

    That's the setuid bit, and you can set it with
    Code:
    chmod u+s
    Similarly, you can set the setgid bit with
    Code:
    chmod g+s
    Or you can use octal, like you've been experimenting with:

    1 = Sticky bit
    2 = Setgid bit
    4 = Setuid bit
    http://xkcd.com/293/
    There are 10 kinds of people in this world: Those who understand ternary, those who don't, and those who confuse it with binary.

Tags for this Thread

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
  •