Page 1 of 1

enable SSH access in raspbian-lite.img

Posted: Sat Mar 25, 2017 12:58 pm
by red_mamba
Any one knows how to enable SSH access in raspbian image?

I want SSH to be up and running when I burn the image and power up the device.
Making my custom raspbian img for a project.

Re: enable SSH access in raspbian-lite.img

Posted: Sat Mar 25, 2017 1:04 pm
by DirkS
After writing the image you just create a file named 'ssh' or 'ssh.txt' on the first partition
(that's the only partition visible from Windows)

Re: enable SSH access in raspbian-lite.img

Posted: Sat Mar 25, 2017 10:48 pm
by Electron752
I just normally do "apt-get openssh-server". I known Raspbian has a custom control to enable it, but I'm not sure how it works at the moment and I don't have Raspbian available.

Just creating a file named that is really bad news.

Re: enable SSH access in raspbian-lite.img

Posted: Sat Mar 25, 2017 10:50 pm
by Electron752
Oh, I understand what your saying more. I think you need to wait until the RPI boots before you can enable that.

Re: enable SSH access in raspbian-lite.img

Posted: Sat Mar 25, 2017 10:51 pm
by Electron752
And if you really want to make an image, you can configure the RPI, power it down, then image the SD card after your are finished.

Re: enable SSH access in raspbian-lite.img

Posted: Sun Mar 26, 2017 12:27 am
by mfa298
Electron752 wrote:I just normally do "apt-get openssh-server". I known Raspbian has a custom control to enable it, but I'm not sure how it works at the moment and I don't have Raspbian available.

Just creating a file named that is really bad news.
Raspbian has openssh-server installed but disabled by default. Putting the ssh file in the boot (FAT) partition is a way to signal to a startup script to enable ssh (it's a method that can be setup from any OS for a headless pi), you could also use systemctl enable to enable it from within raspbian, but that requires a keyboard and screen

Re: enable SSH access in raspbian-lite.img

Posted: Sun Mar 26, 2017 11:38 am
by red_mamba
Thanks guys.

I guess I could just mount first partition and add ssh.txt file there.
But I will try systemctl enable first. because I'm already poking on the second partition.

I have this image build in the cloud on my Jenkins build machine running ubuntu, so some suggestions just won't work for me.
Sorry, didn't mention this before.