MarkDarcy
Posts: 25
Joined: Thu Sep 20, 2018 8:23 am

Enable remote login via USB Serial on first boot and after updates.

Sun Oct 28, 2018 10:08 am

Hello all,

I notice that the very first time a disk image is booted after having being downloaded from raspberrypi.org, you cannot login via any other means except via the console, even if (as I have done) you have managed to configure a remote login over USB/Serial by mounting the disk in a PC and directly creating/editing the necessary configuration files beforehand.

This situation also occurs after executing:

Code: Select all

rpi-update
or:

Code: Select all

sudo apt-get dist-upgrade
What happens is that a login prompt is displayed at the remote terminal, but then any attempt to login produces the message:

Code: Select all

System is booting up. See pam_nologin(8)
Does anybody know which file I can edit/remove on the disk image before the first boot, or which file I can edit/remove after performing a firmware/distribution update, that will enable me to login over the (already) configured serial connection? It seems authenticaion-module related (i.e. PAM). However, when I looked around for the standard "nologon" files there didn't appear to be any.

When a machine is only accessibly remotely, there is absolutely no way I can simply plug-in a keyboard and a monitor just so I can login that one time immediately after any kind of update. After all, that was the whole point of setting up the remote access in the first place. It appears that I may not be the only person who wants this feature.

Any help greatly appreciated.

Thanks in advance.
Last edited by MarkDarcy on Sun Oct 28, 2018 12:15 pm, edited 1 time in total.

drgeoff
Posts: 10676
Joined: Wed Jan 25, 2012 6:39 pm

Re: Enable remote login on first boot and after updates.

Sun Oct 28, 2018 10:59 am

If Raspbian, use another computer to add any file (even an empty one) with name ssh or ssh.txt to the FAT partition on the card. When the RPi is booted, ssh will be permanently enabled allowing you to ssh in over ethernet. Usual name and password

MarkDarcy
Posts: 25
Joined: Thu Sep 20, 2018 8:23 am

Re: Enable remote login on first boot and after updates.

Sun Oct 28, 2018 11:51 am

Thanks for your response.

In my case, I explained I was accessing via USB/Serial (specifically, having udev spawn a getty when it detects a UART cable on a USB port).

You wouldn't happen to know if there is any workaround for this?

Thanks in advance.

Paul Hutch
Posts: 536
Joined: Fri Aug 25, 2017 2:58 pm
Location: Blackstone River Valley, MA, USA
Contact: Website

Re: Enable remote login via USB Serial on first boot and after updates.

Thu Nov 01, 2018 5:46 pm

Check out this thread for info on getting a USB Serial Adapter console login at boot.
viewtopic.php?t=177728

This thread, viewtopic.php?f=29&t=177076&p=1129209#p1129209, and the article it references, http://0pointer.de/blog/projects/serial-console.html, also helped me get this working.

sdjf
Posts: 1395
Joined: Fri Mar 16, 2012 5:20 am
Location: California
Contact: Website

Re: Enable remote login via USB Serial on first boot and after updates.

Sun Nov 04, 2018 5:01 pm

Paul, how fortuitious! I am running your modified raspbian-lite image (for flashing C.H.I.P) on a pi zero! I cannot for the life of me get ssh working, will serial login work without any extra equipment? I still prefer ssh, but serial is better than nothing. Tried PM'ing you but board will not let me.
FORUM TIP: To view someone's posting history, sign in, click on their user name, then on "Search User's Posts." || Running ArchLinuxArm on Model 2B and 512MB Model B

Paul Hutch
Posts: 536
Joined: Fri Aug 25, 2017 2:58 pm
Location: Blackstone River Valley, MA, USA
Contact: Website

Re: Enable remote login via USB Serial on first boot and after updates.

Sun Nov 04, 2018 11:46 pm

sdjf wrote:
Sun Nov 04, 2018 5:01 pm
will serial login work without any extra equipment?
If the machine you want to connect the RasPi to has 3.3V TTL asynch serial I/O, then no extra hardware needed. For most PC's you'll need either a 3.3V TTL to USB or 3.3V TTL to TIA-232 adapter board.

BTW It appears PM's aren't enabled right now, probably

sdjf
Posts: 1395
Joined: Fri Mar 16, 2012 5:20 am
Location: California
Contact: Website

Re: Enable remote login via USB Serial on first boot and after updates.

Thu Nov 15, 2018 10:22 am

Paul, thank you. It turns out I will not need a serial connection to pi zero, Was able to successfully ssh in using a new ethernet adapter and improved power supplies for both my old Model B's ethernet adapter and the hub on pi zero. Not sure which factor was more important, would take more testing.
FORUM TIP: To view someone's posting history, sign in, click on their user name, then on "Search User's Posts." || Running ArchLinuxArm on Model 2B and 512MB Model B

Return to “Advanced users”