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 6391945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:45:00+00:00 2026-05-25T03:45:00+00:00

At my company, some commands are allowed to run with sudo, such as tcpdump.

  • 0

At my company, some commands are allowed to run with sudo, such as tcpdump. Others not.

I expect run tcpdump for a while, and then stop it.
When I run tcpdump, and I could abort that with Ctrl+C

I wrote a shell script like this –

#!/bin/sh
sudo tcpdump -ieth1 -w ~/dump.bin
sleep 5
kill -2 $!

it doesn’t really work. The process of tcpdump is run as root, and current user is a normal account.

My question is: is there any way to do the equivalent of ctrl c in bash script?.

EDIT:

ps:As my company’s security policy, I cannot run kill as root.

  • 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-05-25T03:45:01+00:00Added an answer on May 25, 2026 at 3:45 am

    Try the -Z option to tcpdump. It instructs tcpdump to drop root privileges and run as the user specified in the argument.

    sudo tcpdump -Z $USER -ieth1 -w ~/dump.bin
    

    Now try killing that process.

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

Sidebar

Related Questions

While renewing iOS Developer program I have found Apple generated some Company ID instead
I'm debugging some PHP code written by an outsourcing company (I'm not a PHP
I have some Company names as Items in a ComboBox like this: 123 SomeCompany
We'll soon have some high school kids here in our company for some training
I want to have URLs like this: some-company-name-deal-id-6.htm So the rewrite rule should ignore
In some software company, who should be responsible for the UI design: User Designer
Our company is offering some trainings and asks us what would we want to
Recently, in company we got some MSSQL database from some old project which we
Our company, Company A, may soon be partnering with Company B under some sort
My company is beginning to write some code using Scala. I've been moved onto

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.