# daemon doesn't shuts down ssh

## DaggyStyle

hello,

I have a script that runs one of its function as daemon, it works great in bash but when I want to run the command via ssh, the connection stays open and doesn't get closed.

how can I get the same behavior as in normal bash session?

----------

## Voltago

Have you tried disassociating the daemon from the calling script by using

```
nohup /usr/bin/daemon_binary
```

?

----------

## DaggyStyle

yup, I still need to hit CTRL+C to continue

----------

## Hu

Does the problem still occur if you set ssh not to forward anything over the tunnel?  No X11 forwarding, no port forwarding, no agent forwarding, etc.

----------

## DaggyStyle

 *Hu wrote:*   

> Does the problem still occur if you set ssh not to forward anything over the tunnel?  No X11 forwarding, no port forwarding, no agent forwarding, etc.

 

is it possible to do when invoking the ssh command? I don't want to disable that in compilation.

----------

## Hu

Yes.  It can also be done in your ssh configuration.  See man ssh_config.  By default, most things are not forwarded.  Many people configure X11 forwarding to trusted peers, so I assumed you had done so.

----------

## DaggyStyle

 *Hu wrote:*   

> Yes.  It can also be done in your ssh configuration.  See man ssh_config.  By default, most things are not forwarded.  Many people configure X11 forwarding to trusted peers, so I assumed you had done so.

 

can't seem to find port forwarding, any idea where is it?

----------

