# How to start ssh daemon



## a129878 (Mar 16, 2010)

What is the prefered way to auto start the sshd.
Uncomment the inetd.conf
OR
sshd_enable in rc.conf.

What is the difference, is there any ?

.


----------



## tbyte (Mar 16, 2010)

sshd_enable="YES" in the /etc/rc.conf

`/etc/rc.d/sshd start`

It's the better way


----------



## SirDice (Mar 16, 2010)

a129878 said:
			
		

> What is the difference, is there any ?



From sshd(8):


> -i      Specifies that sshd is being run from inetd(8).  sshd is normally not run from inetd because it needs to generate the server key before it can respond to the client, and this may take tens of seconds.  Clients would have to wait too long if the key was regenerated every time.  However, with small key sizes (e.g. 512) using sshd from inetd may be feasible.



In short, start sshd as a daemon. Forget about inetd.


----------



## jemate18 (Mar 17, 2010)

as for me, start it as a daemon


----------



## darekpawel (Dec 1, 2019)

I've followed that brief instruction, i.e. 'sshd_enable="YES"' in the '/etc/rc.conf',
but each time when I switch-off the PC, the 'sshd' is not starting automatically.
I must start in manuall with 'service sshd start'.

Is that still any other config entry to enable the 'sshd' start automatically after reboot???


----------



## marius_d (Feb 14, 2020)

Hi,
I had the same problem, and found the solution:
as sudo run the following command:

```
sudo rc-update add sshd boot
```


----------



## SirDice (Feb 14, 2020)

marius_d said:


> I had the same problem, and found the solution:


That's a Gentoo solution, that's definitely never going to work on FreeBSD.


----------



## Sevendogsbsd (Feb 14, 2020)

darekpawel: can you post the exact line in your /etc/rc.conf (using CODE tags please) so we can see what the content looks like?


----------



## SirDice (Feb 14, 2020)

`% sudo sysrc sshd_enable="YES"`


----------



## marius_d (Feb 14, 2020)

SirDice said:


> That's a Gentoo solution, that's definitely never going to work on FreeBSD.


It worked on my GhostBSD 20.01 (which is based on FreeBSD 12.1)


----------



## Sevendogsbsd (Feb 15, 2020)

“Based on” does not mean “is”. And actually I just looked this up: GhostBSD is not based on FreeBSD at all but based on TruOS. I have no idea what TruOS is or if it is a derivative of something.

Point is, just because an OS may be similar, doesn’t mean commands from one will work in another.


----------



## nalatroz (Feb 16, 2020)

TrueOS is based off of FreeBSD(-CURRENT to be more accurate). If I remember right it used to be called PC-BSD until a couple of years ago,


----------

