The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Kill process

Discussion in 'General Discussion' started by efeito, Sep 16, 2003.

  1. efeito

    efeito Well-Known Member
    PartnerNOC

    Joined:
    Jul 24, 2003
    Messages:
    141
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    .pt
    Hi to all,

    i have a user that have shell access to one of my servers. I can't remove the access to him, but he start a Half Life server once in a while.

    My question is: can anyone tell me how can i put some "script" or anything else that when he run a command the process was "killed" by the server.

    I know he dont have much experience, so this is enough to make him give up of that.

    Thanks.

    cPanel.net Support Ticket Number:
     
  2. NightHawk

    NightHawk Member

    Joined:
    Apr 17, 2003
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    If you don't want him running any proccess...then you are best off disabling his ssh access...just set him to /bin/false ...instead of /bin/bash. (and yes, I know your post says you can't remove his access....but really if you are going to kill every proccess he runs..you are removing his access...so you might as well do it the easy way.)

    cPanel.net Support Ticket Number:
     
  3. efeito

    efeito Well-Known Member
    PartnerNOC

    Joined:
    Jul 24, 2003
    Messages:
    141
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    .pt
    I cant... the only problem for me is one process that have the name "hl".

    All the rest he can do... i cant really cut him ssh access.

    Please, any linux guru knows a script to do this?

    Thanks!

    cPanel.net Support Ticket Number:
     
  4. NightHawk

    NightHawk Member

    Joined:
    Apr 17, 2003
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    If you only want to stop him from running a hl server (half-life I am guessing), then just block the ports he uses for it in your firewall (check netstat -anp while it is running to determine which ones those are)...

    You could script a cron like this though..and it would kill that proccess...although this could be dangerous...since other procces could have hl in them..so use with caution..

    for i in `ps -ef | grep hl`; do
    kill -9 $i

    put that in a file .. (killhl.sh for example) ..then set your cron to run that file however often you wish it to run.

    Hope that points you in the right direction.

    cPanel.net Support Ticket Number:
     
  5. Website Rob

    Website Rob Well-Known Member

    Joined:
    Mar 23, 2002
    Messages:
    1,506
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    Alberta, Canada
    cPanel Access Level:
    Root Administrator
    I would suggest you take a Management approach, if running a half-life process is not included within the service you provide and/or goes against your TOS, simply tell them to stop. Next offence will be a warning and account termination on second incident.

    You know that if you shut down the process the Client will find out about it. They may take offence and you'll have to defend why you did what you did. In any struggle, preventing a loss (or bad situation in this case) before it happens, is always better than the alternative.

    cPanel.net Support Ticket Number:
     
  6. efeito

    efeito Well-Known Member
    PartnerNOC

    Joined:
    Jul 24, 2003
    Messages:
    141
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    .pt
    Thanks to all for the help and advices!

    I'm go for both solutions, i will warn him and put the script in cron, just in case.

    Thanks once again!

    cPanel.net Support Ticket Number:
     
  7. ThunderHostingDotCom

    ThunderHostingDotCom Well-Known Member

    Joined:
    Nov 18, 2002
    Messages:
    450
    Likes Received:
    1
    Trophy Points:
    16
    Location:
    All over!
    How do I find out what version of SSH I am running?

    cPanel.net Support Ticket Number:
     
  8. NightHawk

    NightHawk Member

    Joined:
    Apr 17, 2003
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    login to your server as admin
    su - (to root)
    ssh -V

    cPanel.net Support Ticket Number:
     
  9. ThunderHostingDotCom

    ThunderHostingDotCom Well-Known Member

    Joined:
    Nov 18, 2002
    Messages:
    450
    Likes Received:
    1
    Trophy Points:
    16
    Location:
    All over!
    OpenSSH_3.1p1, SSH protocols 1.5/2.0, OpenSSL 0x0090602f

    Not good is it?

    cPanel.net Support Ticket Number:
     
  10. NightHawk

    NightHawk Member

    Joined:
    Apr 17, 2003
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    You might want to upgrade to at least
    OpenSSH_3.5p1

    cPanel.net Support Ticket Number:
     
  11. ThunderHostingDotCom

    ThunderHostingDotCom Well-Known Member

    Joined:
    Nov 18, 2002
    Messages:
    450
    Likes Received:
    1
    Trophy Points:
    16
    Location:
    All over!
    OK, what is the best way to update only SSH?

    cPanel.net Support Ticket Number:
     
Loading...

Share This Page