S
S
Sergey2019-02-11 00:37:29
ubuntu
Sergey, 2019-02-11 00:37:29

How to import the root password into the database in .sh?

Goodnight. I am writing a .sh script, the goal is the following:
.sh in an automatic manner, should write the password from the server / VDS to the .sql file, and then import it into the database.
Example: Products from ISPsystem
OS on which it needs to be implemented: Debian 7,8,9

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2016-07-31
@yaka

Decided to search, found:
man split
split --bytes=1450M /dev/sdX /path/to/file.
PS: I did not check it on the disk, it works on the file.

P
pfg21, 2019-02-11
@t3g1ng

The user's password is not stored in plain text anywhere in Linux. it would be a security hole bigger than a secretary :)
/etc/shadow contains the hash of the user's password (with salt and other bells and whistles).
if you have access to this file, then you can take the hash, take the hash generation algorithm and check the entered user password for a match with the hash in the shadow.
but IMHO it is better to look towards PAM, I think this is just what you need.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question