December 2018
Beginner
452 pages
12h 17m
English
Another task that you may find yourself wanting to script is setting the password for a local user. While this is not always good practice from a security standpoint (especially for personal user accounts), it is something that is used for functional accounts (users that correspond to software, such as the Apache user running the httpd processes).
Most of these users do not need a password, but sometimes they do. In this case, we can use pipes with the chpasswd command to set their passwords:
reader@ubuntu:~/scripts/chapter_12$ vim password-setter.sh reader@ubuntu:~/scripts/chapter_12$ cat password-setter.sh #!/bin/bash###################################### Author: Sebastiaan Tammer# Version: v1.0.0# Date: 2018-11-10 ...