Timeline for Change username using a script [closed]
Current License: CC BY-SA 3.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 5, 2017 at 12:28 | comment | added | goldilocks♦ |
Worth observing that man usermod notes, "You must make certain that the named user is not executing any processes when this command is being executed if the user's numerical user ID, the user's name, or the user's home directory is being changed." I agree w/ Steve, BTW. Further it sounds to me like what you are doing should be run as a root process. Since sudo pi has superpowers on Raspbian anyway, this would hardly be a greater risk (if that's the objection in the first place -- I dunno why you want to configure the system using a user account).
|
|
May 5, 2017 at 12:23 | comment | added | goldilocks♦ | -> I dunno whether the problem is because the user needs to log in again, or it is just WRT the current process. It would not take me long to figure that out, of course, but neither I nor most other people are going to bother in order to solve someone else's online problem. So you either need the attention of people who do know this already, meaning a bigger pool of linux expertise (e.g., U&L), or you need to figure it out yourself and explain it explicitly -- "the user needs to log in again", or, "a new process needs to be started". In which case you have a big clue about #2 above. | |
May 5, 2017 at 12:23 | comment | added | goldilocks♦ | I.e., 1) You want to figure out how you can do _____ by any means, then 2) Figure out how to automate that. I think you already have #1. WRT #2, automation does not mean being limited to "the same script". The reason this is a bad fit here is because the fine print caveats of changing a username are relatively obscure, because it is not a common task -> | |
May 5, 2017 at 11:58 | comment | added | F. Pareto | @goldilocks okay let's forget about using "the same script". With ease of setup in mind how would you go about doing this? I want to minimize input from humans to minimize mistakes after programming the 100th in a row. | |
May 5, 2017 at 11:08 | history | closed | goldilocks♦ | Not suitable for this site | |
May 5, 2017 at 11:08 | comment | added | goldilocks♦ | It sounds like the real problem here is your insistence that everything be done using "the same script". Anyway, the question would be more appropriate to our larger sibling site Unix & Linux. | |
May 5, 2017 at 8:25 | answer | added | Milliways | timeline score: 2 | |
May 5, 2017 at 8:17 | comment | added | F. Pareto | @Milliways, good point. The reason to change the username is for security (changing only the password while leaving the standard username makes it slightly easier to break into) but also because we just want it to be called our product's name. SteveRobillard, I thought about this but then I would still be unable to delete the pi user using the same script. Thanks for the recommendation, I will look into them. | |
May 5, 2017 at 8:04 | comment | added | Steve Robillard | If you insist on doing this why not create a new user with the same permissions as presumably the Pi user (that you want to change) then delete/lockout the pi user. You may also want to look at config management tools that make this easier (e.g. puppet, chef, ansible). | |
May 5, 2017 at 8:02 | comment | added | Milliways | You say "and for that we need to, of course, change the username". There is no of course about it. What do you actually hope to achieve that can't be done by more conventional means? | |
May 5, 2017 at 7:49 | history | asked | F. Pareto | CC BY-SA 3.0 |