File Permissions
I'm writing a simple installer and I'm stumped
on how to create user accounts. How cant I create root account without first being root? This installer is made only in C++. Thanks for your help! |
Quote:
|
Quote:
My question is what can I do to get a root password from the user during the install process? Thanks for the quick reply. |
Don't...
The usual solution is to start sudo with the command you want processed. Sudo will then prompt for the appropriate password if the user is authorized... If you are using a GUI there are a couple of GUI versions that accomplish the same thing. The reason you don't is that there is NO reason for the user to trust your installer beyond what it should be doing. There is no reason for it to HAVE the root password, as you may have a trojan that passes the root password off to someone else... |
Quote:
we are in the install process. This "catch-22" is almost breaking my will. |
If the admins are installing the system, they are the ones to set it up.
Not you. You DO get to tell them to configure it. But it is up to the site policy as to who gets to do what to the system. And passing the root password around is not a proper security policy. Now if you are writing a system installer, then your installer is ALREADY root. But most of those are NOT written in C++. They are frequently done in Python, or shell scripts. |
Quote:
I'm thinking about the Anaconda installer. During the install process the installer asks for a user generated password for the root account. I would just like to take that input and finish installing a custom distro. I am most comfortable in C++. I'm aware of the runtime support needed to get things going. Thanks for your help! |
It is much more flexible to use one already written - such as Anaconda.
Installation tools are quite large, and have to handle a number of complex subjects. That was why Anaconda is written in Python. And it is possible to do a custom distribution with Anaconda - it usually called a "spin", and there are tools available that make it realatively easy to do. http://fedoraproject.org/wiki/How_to...fedora_desktop |
Quote:
unpack all the packages set up language, time, etc what else ? anaconda is very complex, not recommended playing around with |
Quote:
display setup, disk partitioning, identifying the target to install on (partition/lvm/mdadm + partitioning) identifying the source to retrieve the packages from (URL/net? disk? USB? NFS?) and setup, package selection (assuming there IS a choice). filesystem to use (xfs,ext4,btrfs,other?) boot configuration and initialization, mount configuration (fstab setup mostly), swap configuration and initialization, Of course, if all of this is supposed to be done, then you aren't doing an installation, but something closer to just cloning a disk... In which case all you do is install the finished clone. Anaconda is rather complex because it is trying to do something that IS complex. |
Thank you all for your response.
I am not interested in spinning a distro with Anaconda. I have written the installer already. Minus the "root problem". I just need some kind of way to get around this "catch-22". Once again, thanks! (I might end up using Anaconda but the question on how to solve this problem will eat at me) |
Quote:
|
Quote:
I'm just thinking that the solution will be Python specific but I'll comb the source. Thanks! |
No. It can't be specific. The technique is not that complicated.
Another place to look would be in the passwd utility. It does the same thing. Now one thing that MAY be a problem is that during the initial install, the terminals are NOT configured. You have to do that if you are using a terminal interface. If you are using a GUI, then Anaconda is quite reasonable to look at, as it uses the same GUI libraries that you would likely be using. |
Quote:
have been very accommodating. Cheers, friend. I'll come back to this post and report later this evening. Once again, thanks! |
All times are GMT -5. The time now is 03:09 PM. |