LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-28-2018, 04:07 PM   #1
Hondaspeed
LQ Newbie
 
Registered: Oct 2018
Distribution: Mint Mate, Raspbian
Posts: 4

Rep: Reputation: Disabled
Unable to ssh-connect to host Raspberry after remote shutdown command


Hello everbody!
As a newbee on this forum, I thought I will post this question here. And I am pretty new with Linux anyway.
I have been running a Raspberry Pi with Raspbian as server for my music system at home for a while with pretty good results.

Because of a power outage the HDD's had to be reconnected and the system had to be reset.
The Pi itself was still running and accessible via ssh.
I wanted to shutdown the Pi using the shutdown -n command, to disconnect and reconnect some external storage.
It shutdown accordingly and now, when I want to connect remotely via ssh, I get the following message:
ssh pi@192.168.178.22
pi@192.168.178.22's password:
The system is going down on Sun Oct 28 14:15:36 2018
Connection to 192.168.178.22 closed by remote host.
Connection to 192.168.178.22 closed.
I restarted the Pi by reconnecting the power already, with the same results.
How can I remote connect to the Pi again without having to access the Pi locally?
I don't have a monitor to connect to the Pi, so I have to operate it via ssh.
 
Old 10-28-2018, 05:52 PM   #2
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,750

Rep: Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222
I don't see a -n option for shutdown. I'm not sure what it would do as it might be interpreted as a time option.
I do find this in the man page
Code:
If the time argument is used, 5 minutes before the system goes down the /run/nologin file is created to ensure that further logins shall not be allowed.
so that's probably the cause of your message.

Were you able to connect after Sun Oct 28 14:15:36 2018 ?

Please clarify.
You ran the shutdown command...yes?
The machine turned off by itself...yes?
You performed your maintenance.
You turned the machine back on and waited for it to boot up.
Then, you got the stated response.

Is that accurate. Or did you kill power manually before the 'puter turned itself off?
 
Old 10-28-2018, 06:26 PM   #3
Hondaspeed
LQ Newbie
 
Registered: Oct 2018
Distribution: Mint Mate, Raspbian
Posts: 4

Original Poster
Rep: Reputation: Disabled
Hi Scasey, thanks for your reply.

Sorry, must have been -h, I think, including the time argument 5. Not sure of the actual command I have given. I am not a newbie for nothing.
I actually thought the time was specified in seconds instead of minutes.
So after the shutdown I leisurely walked to the Pi and pulled the power.
Must have been within 1 minute.
The time and date mentioned was when it was supposed to shut down.

I guess I will have to drag this big lug of computer to a monitor to get it fixed, am I?
That would have been the easy solution.
I just wanted to see if there was another solution.
Or do you think it will still be possible to fix it remotely?
 
Old 10-28-2018, 06:43 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936
I don't think so. If you can not login via ssh then your only choice is connecting the Pi to a monitor.

Depends on version of Raspbian you running but I suspect the nologin file is in /etc/ and not /run. Which might mean you can not even login locally. You might need to mount the SD card on another machine to delete the file.

Quote:
If shutdown is called with a delay, it will create the advisory file
/etc/nologin which causes programs such as login(1) to not allow new
user logins.
My oldest Pi is still running Raspbian based on debian 7.
 
Old 10-28-2018, 06:57 PM   #5
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
If you have a root password, try logging on as root. /etc/nologin (if it is indeed the cause of your woes) doesn't affect root.
 
Old 10-28-2018, 07:07 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936
By default there isn't a root password and the user Pi is configured as a sudo user. I assume the OP has not set a root password.
 
Old 10-28-2018, 07:22 PM   #7
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,750

Rep: Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222
Quote:
Originally Posted by Hondaspeed View Post
Hi Scasey, thanks for your reply.

Sorry, must have been -h, I think, including the time argument 5. Not sure of the actual command I have given. I am not a newbie for nothing.
I actually thought the time was specified in seconds instead of minutes.
So after the shutdown I leisurely walked to the Pi and pulled the power.
Must have been within 1 minute.
The time and date mentioned was when it was supposed to shut down.

I guess I will have to drag this big lug of computer to a monitor to get it fixed, am I?
That would have been the easy solution.
I just wanted to see if there was another solution.
Or do you think it will still be possible to fix it remotely?
As has been said. Probably not (unless you do have a root user and ssh by root is allowed...)

Is the 'puter near your TV? Can the TV be connected as a monitor? Would it be easier to lug a monitor to it rather than it to a monitor. Just ideas.

For future reference, use
Code:
shutdown now
if you want shutdown to be instantaneous.

Sorry...
 
Old 10-29-2018, 05:56 AM   #8
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,927
Blog Entries: 45

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Member response

Hi,

Some 'man shutdown' will show;
Quote:
-n [DEPRECATED] Don't call init(8) to do the shutdown but do it ourself. The use of this option is discouraged, and its results are not always what you'd
expect.
Hope this helps.
Have fun & enjoy!
 
Old 10-29-2018, 03:12 PM   #9
Hondaspeed
LQ Newbie
 
Registered: Oct 2018
Distribution: Mint Mate, Raspbian
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thank you all for giving me some advise.
I think I will be able to fix it with your tips.
Connecting to the TV is possible. I don have space to put a monitor where it sits now. And I don't have a monitor anyway.
Main reason for asking the question was to learn, and that I did.
There is still soo much to learn, and at the pace I am going it will take a while.
I will let y'all know how I fared.
 
Old 10-30-2018, 06:53 PM   #10
Hondaspeed
LQ Newbie
 
Registered: Oct 2018
Distribution: Mint Mate, Raspbian
Posts: 4

Original Poster
Rep: Reputation: Disabled
Here a follow up on this problem.
I have connected the Pi to the TV.
Results: Does not compute...
It attempts to boot but fails. It mentions something about lack of space.
Checking the internal SD card on the laptop showed a problem I encountered before, I believe it was also after a power out:
The SD card was full.
Reason: I have one HD with data and a second HD with weekly backup of this data connected to the Pi.
Somehow, when the backup disk is not mounted, it starts writing the backup to the internal SD card. Of course this does not fit.
This causes the Pi to brick.
I tried wiping the backup data from the SD but this does not work. The pi still doesn't boot.
Simplest way to recover from this problem is to put a recent backup of the SD card back.
I still have to check the harddisks to see if they are not corrupt. Happened to me before.
Luckily, back then I could recover most of the data.
Hopefully this time the hdisks are ok.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
unable to connect to any of the specified host exception is displaying while trying to connect to remote database nsoma26@gmail.com Linux - Newbie 4 03-08-2018 06:50 AM
unable to connect to remote host using ssh tariq Linux - Newbie 31 11-04-2011 09:01 AM
telnet: Unable to connect to remote host: No route to host grob115 Linux - Networking 3 07-30-2010 10:18 AM
Fedora 10/unable to ssh out from box to remote host (SSH within LAN ok) huskeypm Linux - Networking 3 04-14-2009 07:37 PM
how 2 connect 2 remote host using SSH fhameed Linux - Networking 2 09-08-2004 08:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration