# Enable SSH & Systemctl application in the Passive partition

**URL:** <https://hub.mender.io/t/enable-ssh-systemctl-application-in-the-passive-partition/2211>\
**Category:** General Discussions\
**Tags:** raspberry-pi-3\
**Created:** [July 20, 2020, 1:15pm UTC](https://hub.mender.io/t/enable-ssh-systemctl-application-in-the-passive-partition/2211 "2020-07-20T13:15:30Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![arun](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/arun/32/1209_2.png) [@arun](https://hub.mender.io/u/arun)\
**Post date:** [July 20, 2020, 1:15pm UTC](https://hub.mender.io/t/enable-ssh-systemctl-application-in-the-passive-partition/2211/1 "2020-07-20T13:15:30Z")

</div>

Hi,

I have successfully completed full system update .  
But in the active partition ssh is enabled,but before update it is not unable in Partition B.  
Also there are some systemctl app running which should be present in both the Partition.   
After the Successful system update it also start on boot up.  
Any reference or suggestion how to achieve this.

Thanks & Regards  
Arun

---

<div class="post-metadata">

**Author:** ![dellgreen](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/dellgreen/32/85_2.png) [@dellgreen](https://hub.mender.io/u/dellgreen)\
**Post date:** [July 20, 2020, 2:04pm UTC](https://hub.mender.io/t/enable-ssh-systemctl-application-in-the-passive-partition/2211/2 "2020-07-20T14:04:05Z")

</div>

Hi Arun,

Not totally clear on what you wish to achieve, but running systemctl enable just creates symlinks from service units to particular locations on the file system. One option could be as part of the update to mount partition B and create the required symlinks as you see fit. But it really depends on your requirements.

[https://www.freedesktop.org/software/systemd/man/systemd.unit.html](https://www.freedesktop.org/software/systemd/man/systemd.unit.html)

---

<div class="post-metadata">

**Author:** ![arun](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/arun/32/1209_2.png) [@arun](https://hub.mender.io/u/arun)\
**Post date:** [July 20, 2020, 2:09pm UTC](https://hub.mender.io/t/enable-ssh-systemctl-application-in-the-passive-partition/2211/3 "2020-07-20T14:09:59Z")

</div>

Hi Dellgreen,

Thanks For the Reply ,Actually my device is at other location and i am taking SSH ,after system update SSH is disabled so i have manually go to device location and again enable SSh .  
i just want that that SSH will be enable in Partion A and after Update in Partion B also.  
Thanks  
Arun

---

<div class="post-metadata">

**Author:** ![dellgreen](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/dellgreen/32/85_2.png) [@dellgreen](https://hub.mender.io/u/dellgreen)\
**Post date:** [July 20, 2020, 2:45pm UTC](https://hub.mender.io/t/enable-ssh-systemctl-application-in-the-passive-partition/2211/4 "2020-07-20T14:45:52Z")

</div>

Is this a yocto based operating system?

---

<div class="post-metadata">

**Author:** ![arun](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/arun/32/1209_2.png) [@arun](https://hub.mender.io/u/arun)\
**Post date:** [July 20, 2020, 2:52pm UTC](https://hub.mender.io/t/enable-ssh-systemctl-application-in-the-passive-partition/2211/5 "2020-07-20T14:52:30Z")

</div>

Hi  
Its a Raspbian buster lite with integrated mender.

Thanks  
Arun

---

<div class="post-metadata">

**Author:** ![dellgreen](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/dellgreen/32/85_2.png) [@dellgreen](https://hub.mender.io/u/dellgreen)\
**Post date:** [July 20, 2020, 3:08pm UTC](https://hub.mender.io/t/enable-ssh-systemctl-application-in-the-passive-partition/2211/6 "2020-07-20T15:08:08Z")

</div>

ok so it sounds like you are creating the image manually and then using mender-convert tools to integrate mender?

---

<div class="post-metadata">

**Author:** ![arun](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/arun/32/1209_2.png) [@arun](https://hub.mender.io/u/arun)\
**Post date:** [July 20, 2020, 3:17pm UTC](https://hub.mender.io/t/enable-ssh-systemctl-application-in-the-passive-partition/2211/7 "2020-07-20T15:17:45Z")

</div>

I am using the image which is available in mender website for getting started.  
[https://docs.mender.io/hosted/get-started/preparation/prepare-a-raspberry-pi-device](https://docs.mender.io/hosted/get-started/preparation/prepare-a-raspberry-pi-device)

---

<div class="post-metadata">

**Author:** ![dellgreen](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/dellgreen/32/85_2.png) [@dellgreen](https://hub.mender.io/u/dellgreen)\
**Post date:** [July 20, 2020, 3:26pm UTC](https://hub.mender.io/t/enable-ssh-systemctl-application-in-the-passive-partition/2211/8 "2020-07-20T15:26:30Z")

</div>

Ah i see, i assume you have you tried the methods outlined in the following link to permanently enable ssh in the pi?

[https://www.raspberrypi.org/documentation/remote-access/ssh/README.md](https://www.raspberrypi.org/documentation/remote-access/ssh/README.md)

---

<div class="post-metadata">

**Author:** ![arun](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/arun/32/1209_2.png) [@arun](https://hub.mender.io/u/arun)\
**Post date:** [July 20, 2020, 3:30pm UTC](https://hub.mender.io/t/enable-ssh-systemctl-application-in-the-passive-partition/2211/9 "2020-07-20T15:30:06Z")

</div>

Yes i have done the same steps mentioned in the link but it only works for active Partition.

Thanks  
Arun

---

<div class="post-metadata">

**Author:** ![dellgreen](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/dellgreen/32/85_2.png) [@dellgreen](https://hub.mender.io/u/dellgreen)\
**Post date:** [July 20, 2020, 4:43pm UTC](https://hub.mender.io/t/enable-ssh-systemctl-application-in-the-passive-partition/2211/10 "2020-07-20T16:43:10Z")

</div>

I think this is a symptom that the raspberry pi example your link points to seems to be for demonstration purposes (albeit I’m not familiar with this way of doing mender updates). Normally you use some kind of build process/pipeline/tools that creates the rootfs how you want it and then gets converted/created to the final mender A/B partition layout with the exact same contents in A/B. (i.e yocto, golden image-\>mender-convert, mkosi-\>mender-convert), plus mender-artifact created at the same time.

You could add a custom systemd service to your pi image, that runs a script to check the inactive partition and mounts and creates the missing ssh systemd symlink if its absent. Then follow the mender artifact instructions to create a new update from your running pi, upload and deploy.

---

<div class="post-metadata">

**Author:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [July 20, 2020, 5:00pm UTC](https://hub.mender.io/t/enable-ssh-systemctl-application-in-the-passive-partition/2211/11 "2020-07-20T17:00:12Z")

</div>

Hi @arun

As @dellgreen says this image is really for testing and demo purposes. You should consider developing your own custom Golden Master image of Raspbian with SSH and other services you want enabled. Then if you use mender-convert on _that_ image you should have what you need.

That said, specifically for the ssh service, you can use the RaspberryPi OS support for headless configuration to force ssh to be enabled. [See section 3 here.](https://www.raspberrypi.org/documentation/remote-access/ssh/README.md)

However, due to the reworking of the partitions that has happened with the Mender-enabled images, instead of creating the 0-byte file named ssh in the boot partition you need to ensure that that file exists in the /boot directory of the rootfs image in the Mender artifact. You can use _mender-artifact cp_ to modify the artifact and add that particular file.

Drew

---

<div class="post-metadata">

**Author:** ![arun](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/arun/32/1209_2.png) [@arun](https://hub.mender.io/u/arun)\
**Post date:** [July 23, 2020, 12:13pm UTC](https://hub.mender.io/t/enable-ssh-systemctl-application-in-the-passive-partition/2211/12 "2020-07-23T12:13:30Z")

</div>

Hi @drewmoseley,  
Thanks for quick response. so as suggested i am trying to put image in the mender convert but still not clear with RaspberryPi OS support for headless configuration to force ssh to be enabled in the mender convert and also some other required bash files.  
Thanks  
Arun

---

<div class="post-metadata">

**Author:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [July 23, 2020, 2:58pm UTC](https://hub.mender.io/t/enable-ssh-systemctl-application-in-the-passive-partition/2211/13 "2020-07-23T14:58:37Z")

</div>

There are two methods that will work. The first is the link I posted above but that is limited to just enabling serial, ssh and wifi.

The best method is to simply deploy the RaspberryPi OS image, before using mender-convert, enabling ssh with raspi-config and setting up any other files you may need. Then use dd to take an image of the updated SDCard and use that as input to mender-convert. This is the standard mechanism of using a Golden Master image with Mender.

Some related links that may help clarify:

- [Workflow of updates](https://hub.mender.io/t/workflow-of-updates/1735)
- [https://www.linuxjournal.com/content/linux-iot-development-adjusting-binary-os-yocto-project-workflow](https://www.linuxjournal.com/content/linux-iot-development-adjusting-binary-os-yocto-project-workflow)

Drew
