Code Monkey home page Code Monkey logo

Comments (8)

gitbls avatar gitbls commented on September 7, 2024

With passwords like that it's no surprise that you can't login! 🤣

Seriously, the issue is that your passwords have dollar signs in them ($). As you may know, bash uses the dollar sign to indicate a variable.

Since you're using plugins on the command line those dollar signs are subject to bash interpretation, so your password got changed. For free!

One handy feature of the user plugin is the log=/path/on/host/to/logfile where it logs what it actually found. FYI, the log is written in Phase 0, but the actual work is done in Phase 1. A bit confusing, but once you know, you know.

I used the log argument and saw that your passwords were modified. Here's a snippet from the user plugin log. First entry was using your command line as is, second was after I implemented the first solution below.

Date                Operation        User/Group      IMG/Hostname

2024-05-31 14:37:00 Add User         cord            2024-03-15-raspios-bookworm-arm64-lite.img
                    password:m&TWq6SD#xMK4YunNB homedir:/home/cord 
                    groups:dialout,cdrom,floppy,audio,video,plugdev,users,adm,sudo,users,input,netdev,spi,i2c,gpio

2024-05-31 14:39:37 Add User         cord            2024-03-15-raspios-bookworm-arm64-lite.img
                    password:m&TWq6SD#xM$6K4YunNB homedir:/home/cord 
                    groups:dialout,cdrom,floppy,audio,video,plugdev,users,adm,sudo,users,input,netdev,sp

There are two solutions:

  • Leave the command line as is, but quote the $ as \$. This will prevent bash from mangling your passwords.
  • Use --plugfile @/path/to/pluglist on the command line and create /path/to/pluglist with all your plugins in it:
user:adduser=cord|password=m&TWq6SD#xM$6K4YunNB
user:adduser=ansible|password=J$orK7q9Ai#Gumq%PTmU
L10n:host
disables:piwiz 

With this, the lines are read and not subject to bash substitutions, so the \ quotes are not needed, and in fact, will be treated as part of the password.

I use the --plugfile @pluglist for my own build, because it keeps the sdm command lines more manageable, and it's easier to scan the pluglist to see what's there, or not.

Oh, and to answer your specific questions:

  1. Yes, you can add multiple users, and the way you're doing it is fine, except for a little bash password mangling
  2. sdm doesn't impose any restrictions beyond those of RasPiOS, so no.

from sdm.

CordThomasLAS avatar CordThomasLAS commented on September 7, 2024

Thank you, very helpful - I figured as much and should have tried. Hopefully this helps someone else.

from sdm.

CordThomasLAS avatar CordThomasLAS commented on September 7, 2024

Sorry to bother, but now working on another NVMe and wanted to try plugfile option, but can't seem to get it to work. I searched the docs, checked the --help and also searched the source and can't seem to find how --plugfile is supposed to work:

sudo sdm --customize --plugfile /home/cord/plugfile.txt --regen-ssh-host-keys --restart 2024-03-15-raspios-bookworm-arm64-lite.img

gets me

sdm: unrecognized option '--plugfile'

Using sdm V12.2

from sdm.

gitbls avatar gitbls commented on September 7, 2024

Ooops...my bad! It's --plugin @/path/to/plugfile.txt . Sorry about that! And, the file type doesn't need to be '.txt' it's just a Linux file. I use myplugins with no file type whatsoever.

from sdm.

CordThomasLAS avatar CordThomasLAS commented on September 7, 2024

from sdm.

gitbls avatar gitbls commented on September 7, 2024

Great, and I note that the plugfile has to be executable. That worked like a charm.

I don't believe that it needs to be executable. It's only read by sdm running as root, not executed.

from sdm.

CordThomasLAS avatar CordThomasLAS commented on September 7, 2024

Here's what I am using

sudo sdm --customize --plugin /home/cord/plugfile --regen-ssh-host-keys --restart 2024-03-15-raspios-bookworm-arm64-lite.img

If i leave plugfile as rw, then I get this error:

? Plugin /home/cord/plugfile is not executable

from sdm.

gitbls avatar gitbls commented on September 7, 2024

Try this instead:

sudo sdm --customize --plugin @/home/cord/plugfile  ...

You're missing the @ at the front of the plugfile list path, so sdm assumes that the file is a plugin, and plugins must be executable. On the other hand, lists of plugins, denoted with @, are read as text files and do not need to be executable.

from sdm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.