br1
Posts: 13
Joined: Sat Sep 13, 2014 5:14 pm

SSH is not running on startup

Sun Sep 14, 2014 1:54 pm

Hello guys,

I'm running [email protected] ~ $ uname -a
Linux raspberrypi 3.12.28+ #710 PREEMPT Wed Sep 10 15:23:42 BST 2014 armv6l GNU/Linux


and through the command

Code: Select all

 [b]sudo raspi-config[/b]
I'd like to enable the ssh deamon, in order to control remotely the RPi via wired LAN. The problem is that despite of I've enabled the daemon, on boot It is not running. Only after typing sudo /etc/init.d/ssh start, I'm able to use it.
So, could anyone suggest me in what I'm wrong?
PS:I'm using a static ip address for the RPi - I do not if it is a useful information :?
Thanks in advance.

User avatar
B.Goode
Posts: 8987
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: SSH is not running on startup

Sun Sep 14, 2014 3:58 pm

All releases of Raspbian for well over a year have had the ssh server enabled at startup by default.

I wonder if you have unintentionally disabled automatic startup by using the raspi-config tool?

br1
Posts: 13
Joined: Sat Sep 13, 2014 5:14 pm

Re: SSH is not running on startup

Sun Sep 14, 2014 4:55 pm

B.Goode wrote:All releases of Raspbian for well over a year have had the ssh server enabled at startup by default.

I wonder if you have unintentionally disabled automatic startup by using the raspi-config tool?
To be honest, I tried everything! I disabled and then enabled, but still not working until I run manually the daemon. Any help? :roll:

Further information: where can I see the log messages the at boot time the daemon should start?

User avatar
default_user8
Posts: 678
Joined: Mon Nov 18, 2013 3:11 am

Re: SSH is not running on startup

Sun Sep 14, 2014 6:29 pm

If you've exhausted all options, have you considered downloading the latest build and reflashing your sd card?
Two heads are better than one, unless one's a goat head.

User avatar
FLYFISH TECHNOLOGIES
Posts: 1750
Joined: Thu Oct 03, 2013 7:48 am
Location: Ljubljana, Slovenia
Contact: Website

Re: SSH is not running on startup

Sun Sep 14, 2014 8:21 pm

Hi,
br1 wrote:where can I see the log messages the at boot time the daemon should start?
Skim content of files from /var/log/ folder.
If you can't locate any usable information, than you could make a workaround by adding ssh daemon start command in /etc/rc.local file.


Best wishes, Ivan Zilic.
Running out of GPIO pins and/or need to read analog values?
Solution: http://www.flyfish-tech.com/FF32

br1
Posts: 13
Joined: Sat Sep 13, 2014 5:14 pm

Re: SSH is not running on startup

Sun Sep 14, 2014 8:50 pm

FLYFISH TECHNOLOGIES wrote:Hi,
br1 wrote:where can I see the log messages the at boot time the daemon should start?
Skim content of files from /var/log/ folder.
If you can't locate any usable information, than you could make a workaround by adding ssh daemon start command in /etc/rc.local file.


Best wishes, Ivan Zilic.
Could you suggest how?

Anyway, If I won't be able to solve, I'll flash again the microSD. However, this situation is very odd!

User avatar
FLYFISH TECHNOLOGIES
Posts: 1750
Joined: Thu Oct 03, 2013 7:48 am
Location: Ljubljana, Slovenia
Contact: Website

Re: SSH is not running on startup

Sun Sep 14, 2014 8:55 pm

Hi,
br1 wrote:
FLYFISH TECHNOLOGIES wrote:make a workaround by adding ssh daemon start command in /etc/rc.local file.
Could you suggest how?
1) edit /etc/rc.local file (sudo nano /etc/rc.local)
2) just above last command (exit 0) add a line to start ssh (/etc/init.d/ssh start)
3) save & exit


Best wishes, Ivan Zilic.
Running out of GPIO pins and/or need to read analog values?
Solution: http://www.flyfish-tech.com/FF32

User avatar
DougieLawson
Posts: 36548
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: SSH is not running on startup

Sun Sep 14, 2014 9:26 pm

FLYFISH TECHNOLOGIES wrote:Hi,
1) edit /etc/rc.local file (sudo nano /etc/rc.local)
2) just above last command (exit 0) add a line to start ssh (/etc/init.d/ssh start)
3) save & exit
Why not do it properly?
sudo update-rc2.d ssh defaults
sudo update-rc2.d ssh enable

Adding it to /etc/rc.local is an awful hack.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
FLYFISH TECHNOLOGIES
Posts: 1750
Joined: Thu Oct 03, 2013 7:48 am
Location: Ljubljana, Slovenia
Contact: Website

Re: SSH is not running on startup

Sun Sep 14, 2014 10:00 pm

Hi,
DougieLawson wrote:Why not do it properly?
The conversation started with the issue of not being able to set it that way (according to my understanding)...


Best wisehs, Ivan Zilic.
Running out of GPIO pins and/or need to read analog values?
Solution: http://www.flyfish-tech.com/FF32

br1
Posts: 13
Joined: Sat Sep 13, 2014 5:14 pm

Re: SSH is not running on startup

Sun Sep 14, 2014 10:25 pm

FLYFISH TECHNOLOGIES wrote:Hi,
DougieLawson wrote:Why not do it properly?
The conversation started with the issue of not being able to set it that way (according to my understanding)...


Best wisehs, Ivan Zilic.
No the conversation's aim is to understand why even using raspi-config tool, I'm not able to have the ssh daemon running at startup. Anyway if I'm not wrong I did what you're saying, with defaults and enable options, but without any success - again. I'll try again tomorrow, just to be sure.
Last edited by br1 on Mon Sep 15, 2014 7:40 am, edited 1 time in total.

User avatar
DougieLawson
Posts: 36548
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: SSH is not running on startup

Sun Sep 14, 2014 10:32 pm

The ultimate fix may be to uninstall the sshd server stuff with sudo apt-get purge openssh-server && sudo apt-get install openssh-server
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

br1
Posts: 13
Joined: Sat Sep 13, 2014 5:14 pm

Re: SSH is not running on startup

Mon Sep 15, 2014 7:42 am

DougieLawson wrote:The ultimate fix may be to uninstall the sshd server stuff with sudo apt-get purge openssh-server && sudo apt-get install openssh-server
I'm wondering if the problem could be related in someway to the LAN configuration. I do not know, I'm fantasizing about! :P

PROBLEM SOLVED:
I purged and re-installed the openssh-server. Thanks DougieLawson :D

grrilla
Posts: 1
Joined: Fri May 22, 2015 6:36 am

Re: SSH is not running on startup

Fri May 22, 2015 6:40 am

B.Goode wrote:All releases of Raspbian for well over a year have had the ssh server enabled at startup by default.
ppl repeatedly say this and yet none of mine have. always had to set it, and via pi-config no less, what happened rc scripts

alkopop79
Posts: 53
Joined: Thu Mar 08, 2012 7:10 pm
Location: London

Re: SSH is not running on startup

Fri Dec 30, 2016 4:27 am

DougieLawson wrote:
FLYFISH TECHNOLOGIES wrote:Hi,
1) edit /etc/rc.local file (sudo nano /etc/rc.local)
2) just above last command (exit 0) add a line to start ssh (/etc/init.d/ssh start)
3) save & exit
Why not do it properly?
sudo update-rc2.d ssh defaults
sudo update-rc2.d ssh enable

Adding it to /etc/rc.local is an awful hack.
So what do you suggest instead?

User avatar
rpdom
Posts: 15580
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: SSH is not running on startup

Fri Dec 30, 2016 6:16 am

alkopop79 wrote:So what do you suggest instead?
What Dougie said (while fixing the typo - it's rc.d not rc2.d).

Code: Select all

sudo update-rc.d ssh defaults
sudo update-rc.d ssh enable

jahboater
Posts: 4835
Joined: Wed Feb 04, 2015 6:38 pm

Re: SSH is not running on startup

Fri Dec 30, 2016 9:18 am

I'm not sure which version of Raspbian is in use, but its been systemd for some time now.
Perhaps try:

Code: Select all

sudo systemctl enable ssh

User avatar
DougieLawson
Posts: 36548
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: SSH is not running on startup

Fri Dec 30, 2016 9:19 am

It always turns to a stupid mess of chinese whispers when someone bumps a two year old thread written for an expired operating system.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
B.Goode
Posts: 8987
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: SSH is not running on startup

Fri Dec 30, 2016 10:56 am

DougieLawson wrote:It always turns to a stupid mess of chinese whispers when someone bumps a two year old thread written for an expired operating system.

+1 to that.

I was the first responder to the original query over two years ago. What I wrote was accurate at the time. That advice has since been superceded by changes made by the Raspberry Pi Foundation developers to the default configuration of Raspbian.

For current information see:

https://www.raspberrypi.org/blog/a-secu ... ian-pixel/

http://downloads.raspberrypi.org/raspbi ... _notes.txt

viewtopic.php?f=66&t=166984#p1075069

Return to “Raspbian”