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

  • Home
  • SEARCH
  • 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 8219607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T13:13:44+00:00 2026-06-07T13:13:44+00:00

I wrote a small bash script to test suid permission $ cat phone.sh #!/bin/sh

  • 0

I wrote a small bash script to test suid permission

$ cat phone.sh
#!/bin/sh
echo "abc" >> out.txt

$ ls -l out.txt phone.sh
-rw-r--r-- root wzj      ...         out.txt
-rwsr-xr-x root wzj      ...         phone.sh

$ ./phone.sh
./phone.sh: 2: cannot create out.txt: Permission denied

why? I thought I already set the suid permission , so i can run the phone.sh with root privilege to modify the out.txt file , but i just failed. Can anybody tell me where i did wrong please?

  • 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-07T13:13:52+00:00Added an answer on June 7, 2026 at 1:13 pm

    Most *nix OSes don’t allow scripts to utilize SUID. Check out Vidar’s blog entry on the subject. Perl scripts can use SUID, but as Vidar explains, it’s due to how Perl is implemented. It appears Bash scripts simply won’t run with SUID. Sorry I don’t have a more useful answer for you, it looks like this is just “how things are”.

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

Sidebar

Related Questions

Someone can help me write a small ssh script to test if file /usr/modified.txt
I wrote two small applications (a client and a server) to test UDP communication
I wrote a small test program for flipperview. I have 3 views. I call
I wrote a small app that turns out to be using a lot of
I wrote a small program to test accessing a widget parent's slot. Basically, it
I wrote a small script which copies the billing address to the delivery address
I wrote a small script, which parses a XML-file, deletes some redundant elements and
I've created a small Bash script that does a MySQL data dump. Because the
i wrote a small FQL script that returns the latest wallposts of my fanpage.
I wrote a small PHP script to edit the site news XML file. I

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.