Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: can't stop sshd from startup

  1. #1
    Join Date
    Jun 2008
    Beans
    17

    can't stop sshd from startup

    i got a problem with the ssh daemon

    i installed it, but every time i start my system, sshd is running, but i can't find out where it's startup entry is located.

    Code:
    ls /etc/rc*.d | grep ssh
    returns nothing, which indeed is true, 'cause i removed the links from the runlevel directories. i checked the rc.local file which is empty and never added a line anywhere to start the ssh daemon explicit.

    i'm using the latest ubuntu with updates and everything (at least i think so). in my gnome startup application preferences the only thing related to ssh is the ssh key agent. but if i deactivate it, sshd still startsup.

    Code:
    sudo update-rc.d -f ssh remove
    didn't helped either

    (adding the line "/etc/init.d/ssh stop" to rc.local doesn't prevent ssh from beeing run. which means.. ssh is started AFTER rc.local is excuted)

  2. #2
    Join Date
    Jun 2008
    Location
    Netherlands
    Beans
    Hidden!

    Re: can't stop sshd from startup

    Guiwise but still;
    Look under System>Preferences>Startup Applications

    ssh agent will be there
    When your thread it solved: go to thread tools > Mark this thread as solved
    for SIS 771/671 use xcompmgr to have transparent terminals. just load it at startup.

    And then they asked: what's a pbkac error?

  3. #3
    Join Date
    Jun 2008
    Beans
    17

    Re: can't stop sshd from startup

    well can't find it...
    disabling ssh key agent doesn't stop ssh from being launched.
    Attached Images Attached Images

  4. #4
    Join Date
    Jun 2008
    Location
    Netherlands
    Beans
    Hidden!

    Re: can't stop sshd from startup

    I'm browsing around for you.
    When your thread it solved: go to thread tools > Mark this thread as solved
    for SIS 771/671 use xcompmgr to have transparent terminals. just load it at startup.

    And then they asked: what's a pbkac error?

  5. #5
    Join Date
    Jun 2008
    Location
    Netherlands
    Beans
    Hidden!

    Re: can't stop sshd from startup

    http://ubuntuforums.org/showthread.php?t=1402580

    Quote Originally Posted by davidmb View Post
    Hi,

    Haven't really tried it, but this should work:
    1. Open a console.
    2. Type the following:
    Code:
    sudo update-rc.d -f ssh remove
    This won't remove the sshd software package, but it won't automatically start again.

    After this, to start (alternatively "stop") sshd manually you can do the following from the command line:
    Code:
    sudo invoke-rc.d ssh start
    Last edited by mhgsys; June 30th, 2010 at 06:35 PM.
    When your thread it solved: go to thread tools > Mark this thread as solved
    for SIS 771/671 use xcompmgr to have transparent terminals. just load it at startup.

    And then they asked: what's a pbkac error?

  6. #6
    Join Date
    Jun 2008
    Beans
    17

    Re: can't stop sshd from startup

    i already found that post.
    as i told in the first post:
    Code:
    sudo update-rc.d -f ssh remove
    didn't helped and
    Code:
    sudo invoke-rc.d ssh start
    didn't helped either

    invoke-rc.d stops sshd for the current session, but after a reboot, it's online again.

  7. #7
    Join Date
    Oct 2007
    Location
    Chennai, India
    Beans
    3,803
    Distro
    Ubuntu Development Release

    Re: can't stop sshd from startup

    Code:
    sudo service ssh stop
    And it will be stopped until manually restarted again (will not restart after a reboot).

    You can check the status with
    Code:
    sudo service ssh status
    If you want to remove the service permanently, then you can uninstall ssh server
    Code:
    sudo apt-get remove openssh-server
    Last edited by prshah; June 30th, 2010 at 07:27 PM.
    Cheers,PRShah
    Make your own: Ubuntu, Kubuntu, Xubuntu, Mythbuntu All-in-One Live DVD
    "I never make mistakes; I thought I did, once.. but I was wrong."

  8. #8
    Join Date
    Jun 2008
    Beans
    17

    Re: can't stop sshd from startup

    Quote Originally Posted by prshah View Post
    Code:
    sudo service ssh stop
    And it will be stopped until manually restarted again (will not restart after a reboot).

    You can check the status with
    Code:
    sudo service ssh status
    If you want to remove the service permanently, then you can uninstall ssh server
    Code:
    sudo apt-get remove openssh-server
    i didn't know about the "service" command, but it looks like that didn't fix it. i executed "sudo service ssh stop".. return message: "ssh stop/waiting"... then i reboot.. and when i check, ssh status: ssh is running

    i viewed the man page and it looks like service is just a tool to handle the links located in the rc.d directories..

    i don't want to remove ssh cause i need it (sometimes), but it annoys me that i can't work out how to remove that program from automatically starting up.

  9. #9
    Join Date
    Jun 2008
    Location
    Netherlands
    Beans
    Hidden!

    Re: can't stop sshd from startup

    Took me a while but I think I found it;
    Code:
      
    }
    
    check_config() {
        if [ ! -e /etc/ssh/sshd_not_to_be_run ]; then
            /usr/sbin/sshd $SSHD_OPTS -t || exit 1
        fi
    }
    
    So;....

    Create /etc/ssh/sshd_not_to_be_run
    Code:
    sudo nano /etc/ssh/sshd_not_to_be_run
    save it;
    (Ctrl+O , enter, Ctrl+X)
    reboot

    Test results over here;
    mhg@mhg-laptop:~$ killall sshd
    sshd: no process found
    mhg@mhg-laptop:~$ sudo service ssh stop
    stop: Unknown instance


    if you want to run it again; remove /etc/ssh/sshd_not_to_be_run
    Code:
    sudo rm /etc/ssh/sshd_not_to_be_run
    and
    Code:
    sudo service ssh start
    Last edited by mhgsys; June 30th, 2010 at 08:43 PM. Reason: pretty colors..
    When your thread it solved: go to thread tools > Mark this thread as solved
    for SIS 771/671 use xcompmgr to have transparent terminals. just load it at startup.

    And then they asked: what's a pbkac error?

  10. #10
    Join Date
    Jun 2008
    Beans
    17

    Re: can't stop sshd from startup

    thx, it worked...
    just created that file...

    now if i wanna start sshd i need to rename that file.. no problem, just edited the init script.

    which still doesn't solve the issue i don't know why it's starting all the time / even if i removed the rc.d links...

    well thanks for the workaround that will do for now.

Page 1 of 2 12 LastLast

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
  •