Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8859119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:58:44+00:00 2026-06-14T14:58:44+00:00

I have the following root-file with the following contents: $ cat root-file #!/bin/bash echo

  • 0

I have the following “root-file” with the following contents:

$ cat root-file 
#!/bin/bash   
echo $EUID
id

Following are the permissions for this file:

$ ls -l root-file 
-rwsr-sr-x 1 root root 15 Nov 18 02:20 root-file

Since the set-user-id bit is set for this file, I would expect that on executing this
file, the effective uid would be displayed as 0 even when a non-root user executes it (since set-user-id bit causes the process to be executed with the effective user-id of the owner of the file, which in this case is root). However, instead I get the following output on executing “root-file” from a non-root shell.

$ ./root-file 
1000
uid=1000(chanakya) gid=1000(chanakya) groups=1000(chanakya),4(adm),20(dialout),24(cdrom),46(plugdev),105(lpadmin),119(admin),122(sambashare)

This file/or script is not being executed with effective user-id 0. Why is that so?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T14:58:45+00:00Added an answer on June 14, 2026 at 2:58 pm

    you cannot use setuid on shell scripts…

    if you absolutely need to use setuid checkout http://isptools.sourceforge.net/suid-wrap.html

    Normally something like this could also be established using some custom sudo configuration…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created following rule in the .htaccess file located at the root of
I have the following rule defined in the .htaccess file of my webapplication's root
I have the following XML <ns0:Root xmlns:ns0=http://Map_Sample.Input_Schema> <Number1> </Number1> <Number2>11</Number2> <Number3>12</Number3> </ns0:Root> In this
i have following php file.... mysql_connect(localhost,root,); mysql_select_db(database_name); $sql=mysql_query(select * from members); while($row=mysql_fetch_assoc($sql)) $output[]=$row; print(json_encode($output));
I have the following xml file: <?xml version=1.0 encoding=utf-8?> <root> <phrase id=test><![CDATA[test]]></phrase> <phrase id=test0><![CDATA[test0]]></phrase>
Let's say I have the following text file: This is the first line of
I have used the following code to get the document root. $path = get_file_dir();
I have the following xml: <Root> <Item> <CityCode>ALV</CityCode> <AirportCode>ALV</AirportCode> <CityName>ANDORRA LA VELLA</CityName> <AirportName>Andorra La
I have the following XML: <root> <section> <item name=a> <uuid>1</uuid> </item> </section> <section> <item
I have the following xsl with me <Root> <child> <Book name=Title value=hailey /> <Book

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.