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 ?
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 ?