# FX30 Yocto : add new user

**URL:** <https://forum.sierrawireless.com/t/fx30-yocto-add-new-user/31938>\
**Category:** FX30\
**Created:** [March 27, 2024, 10:27am UTC](https://forum.sierrawireless.com/t/fx30-yocto-add-new-user/31938 "2024-03-27T10:27:10Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![sami.brugier](https://avatars.discourse-cdn.com/v4/letter/s/a9a28c/32.png) [@sami.brugier](https://forum.sierrawireless.com/u/sami.brugier)\
**Post date:** [March 27, 2024, 10:27am UTC](https://forum.sierrawireless.com/t/fx30-yocto-add-new-user/31938/1 "2024-03-27T10:27:10Z")

</div>

Hi,

I am currently trying to create a user (let’s call it “sshuser”) to be used for SSH connection, instead of directly having the root user “exposed”.

I managed to create the user, but when I am connecting to my FX30 over SSH with “sshuser”, the connection is successful but instantly closed.

While looking what was wrong, I found out that the home directory of “sshuser” was missing. I had “/home/root”, “/home/admin” but no “/home/sshuser”. However, when looking into the rootfs resulting of the build of my custom Yocto image for FX30, I can see “/home/root” and “/home/sshuser”, but there is no “/home/admin”.

Once “/home/sshuser” manually created on the FX30, I can then successfully log in over SSH using “sshuser”.

Two questions :  
1 : Why is “/home/sshuser” missing on my FX30 and how to fix it without having to manually create it ?  
2 : Where does “/home/admin” come from ?

Thank you in advance for your answer.

Best regards,  
Sami

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/jyijyi/32/4766_2.png) [@jyijyi](https://forum.sierrawireless.com/u/jyijyi)\
**Post date:** [March 27, 2024, 10:45am UTC](https://forum.sierrawireless.com/t/fx30-yocto-add-new-user/31938/2 "2024-03-27T10:45:17Z")

</div>

you can see here:

> **[How to Create Users in Linux (useradd Command)](https://linuxize.com/post/how-to-create-users-in-linux-using-the-useradd-command/)**
>
> In Linux, you can create a user account and assign the user to different groups using the useradd command.

after “useradd -m sshuser”, /home/sshuser will be created.

---

<div class="post-metadata">

**Author:** ![sami.brugier](https://avatars.discourse-cdn.com/v4/letter/s/a9a28c/32.png) [@sami.brugier](https://forum.sierrawireless.com/u/sami.brugier)\
**Post date:** [March 27, 2024, 10:50am UTC](https://forum.sierrawireless.com/t/fx30-yocto-add-new-user/31938/3 "2024-03-27T10:50:36Z")

</div>

Hi,

My user is created by inheriting “extrausers” in my image append of mdm9x28-image-minimal in Yocto and passing the required “EXTRA\_USERS\_PARAMS”.

My user is created, is present in “/etc/passwd”, only the home directory is missing when the image is flashed on the FX30.

My question is about why is the user’s home directory not present.

Still, thank you for your quick answer.

Best regards,  
Sami

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/jyijyi/32/4766_2.png) [@jyijyi](https://forum.sierrawireless.com/u/jyijyi)\
**Post date:** [March 27, 2024, 10:57am UTC](https://forum.sierrawireless.com/t/fx30-yocto-add-new-user/31938/4 "2024-03-27T10:57:34Z")

</div>

how do you set “EXTRA\_USERS\_PARAMS”?

BTW, see if this helps:

> **[R16-Yocto-Adding-Root-Password](https://mangoh.discourse.group/t/r16-yocto-adding-root-password/6294/4)**
>
> no idea… suggest you using passwd directly

---

<div class="post-metadata">

**Author:** ![sami.brugier](https://avatars.discourse-cdn.com/v4/letter/s/a9a28c/32.png) [@sami.brugier](https://forum.sierrawireless.com/u/sami.brugier)\
**Post date:** [March 27, 2024, 11:35am UTC](https://forum.sierrawireless.com/t/fx30-yocto-add-new-user/31938/5 "2024-03-27T11:35:17Z")

</div>

Here is what my “mdm9x28-image-minimal.bbappend” looks like :

```auto
inherit extrausers

EXTRA_USERS_PARAMS = " \
    usermod -p '{ROOT_HASHED_PASSWORD}' root; \
    useradd -p '{SSHUSER_HASHED_PASSWORD}' sshuser;
"

IMAGE_INSTALL += "openvpn"

IMAGE_FEATURES_remove += "debug-tweaks"
IMAGE_FEATURES_remove += "allow-empty-password"

```

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/jyijyi/32/4766_2.png) [@jyijyi](https://forum.sierrawireless.com/u/jyijyi)\
**Post date:** [March 27, 2024, 11:51am UTC](https://forum.sierrawireless.com/t/fx30-yocto-add-new-user/31938/6 "2024-03-27T11:51:58Z")

</div>

Didn’t you need to add -m option?

---

<div class="post-metadata">

**Author:** ![sami.brugier](https://avatars.discourse-cdn.com/v4/letter/s/a9a28c/32.png) [@sami.brugier](https://forum.sierrawireless.com/u/sami.brugier)\
**Post date:** [March 27, 2024, 2:34pm UTC](https://forum.sierrawireless.com/t/fx30-yocto-add-new-user/31938/7 "2024-03-27T14:34:25Z")

</div>

I tried adding “-m” to my “useradd” command, and it looks like it was the missing part. I am a bit surprised, as “/home/sshuser” was present in the built rootfs.tar.bz on my host machine, but it works.

As always, thank you for the quick replies @jyijyi !

I now have a question about disabling factory reset by default. Should I create a new topic ?

Thank you again,  
Sami

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/jyijyi/32/4766_2.png) [@jyijyi](https://forum.sierrawireless.com/u/jyijyi)\
**Post date:** [March 27, 2024, 2:38pm UTC](https://forum.sierrawireless.com/t/fx30-yocto-add-new-user/31938/8 "2024-03-27T14:38:12Z")

</div>

yes, better create new topic
