Open cashxx opened 2 years ago
You can add | sed 's/=//g'
to the end of that line to remove the padding:
p=`system_profiler SPHardwareDataType | awk '/Serial/ {print $4}' | tr '[A-Z]' '[K-ZA-J]' | tr 0-9 4-90-3 | base64 | sed 's/=//g'`
Ahh forgot about sed. Thanks, didn't think of that, will make note of that and try it. Should be added to script as not allow simple passwords I would think would be common setting people set. I also noticed that the password is spread all through logs. Not sure that is a good thing. This isn't the safest setup, but something and better than having the same password on everything. Thank you!
This also seems to work fine, im rather new so its not that pretty :) p=$(echo -n "$(system_profiler SPHardwareDataType | awk '/Serial/ {print $4}')" | tr '[A-Z]' '[K-ZA-J]' | tr 0-9 4-90-3 | base64) its not just the == and since i was doing the script to get the base64 from a windows device my padding was "Cg==" so i needed to it cleaner
In the Manage Accounts scripts, the line that creates the password from serial is a small problem as it adds padding at the end with == for the password and if you have in the policy or configuration profile to now allow simple passwords it won't let you login as local admin because of the == at the end.
p=
system_profiler SPHardwareDataType | awk '/Serial/ {print $4}' | tr '[A-Z]' '[K-WA-C]' | tr 3-6 4-90-3 | base64
Any idea on how to stop the padding or if it happens strip it so only the serial number of the computer is converted?