The rpm package creation does not include the compilation part:
First, write a script. This script is what you want to do. useradd. sh is the script I wrote and 20 users are added in batches. Create a directory and put the script in:
Compress this directory:
We export the verification key:
Replace the system's default key id with the public key id. We create this file ourselves.
Configure a useradd. spec file and fill in the package information to generate a path.
Then install an rpm-build software package:
Rpmbuild. Make it generate an rpmbuild directory in the current directory
Copy the tar package and spec file to the rpmbuild subdirectory.
Rpm package generation architecture:
View the generated software package:
View the package information and sign the package:
Then I will test the software package and generate the installation database file.
Copy the verification key to the system's default verification key:
Configure the yum source to test the software package:
Check whether the installation is successful:
Tip: run laterUseraddFound the system card, very card... We didn't succeed.UseraddPackage name andUseraddIf the system does not know that we want it to execute the command, the system will not move. No other reason can be found for this reason.