1

My problem is simple. I don't have keyboard, so I am unable to type password when booting raspberry with fresh image. Which file on the card (and how) should I edit to enable autologin to the Raspbian?

Or maybe is there some tool eliglibe to raspi-config which can I run from computer which I used to prepare card?

  • Since you have no keyboard, is it safe to assume you're running headless, or do you have a desktop running on a display? Do you have a linux computer available? If not, what sort of desktop do you have? The necessary files are on the ext4 root partition, so you need to be able to mount it to modify them. – bobstro Sep 20 '17 at 20:26
  • I have installed RASPBIAN STRETCH LITE image. I am running Mac. Such problem doesn't occur with the desktop version? – Maciej Treder Sep 20 '17 at 20:28
  • The procedure is different for logging into the command line versus a full desktop. Although you can load drivers to allow mounting of ext4 volumes on your Mac, it might be easiest to boot a linux virtual machine (e.g. using vbox) on your Mac. Alternately, do you have a keyboard and display you could connect temporarily? – bobstro Sep 20 '17 at 20:30
  • What might help you is to enable SSH on your build first: raspberrypi.stackexchange.com/questions/4444/… Then you could SSH into your pi and change the files you need to get auto-login working: raspberrypi.stackexchange.com/questions/48241/… – G Trawo Sep 20 '17 at 20:33
  • Even better than my first link, to enable SSH simply put a file named 'SSH' into the Boot partition. Taken from here: raspberrypi.org/documentation/remote-access/ssh – G Trawo Sep 20 '17 at 20:37
3

You can configure your system to automatically log into the command line by creating a file in /etc/systemd/system/getty@tty1.service.d/override.conf with the following content:

[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin yourname --noclear %I $TERM

You will need RW access to the filesystem. If you can't log into the RPi directly, you can mount the partitions on the card on another system that can mount ext4 partitions (ideally linux) to make these edits. Otherwise, connect the network and make these changes as root.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.