You can use mkbks to populate the BoKS database with lines taken straight from a passwd file.


A currently undocumented option is mkbks -I that allows piping a single line from /etc/passwd to stdin to create a user.

For example

BoKS # echo "foo:x:1000:100:foo bar:/home/foo:/bin/bash"|mkbks -I

This does not set the password for the user, but you can pipe a password hash from /etc/shadow to modbks -l -p -.

NOTE: An advanced command to import the user and password hash in one step is cadm -l -f {passwd|remotepasswd|localpasswd}.

Thus the following example command can be used to import my-user to hostgroup TRUSTED (from Server Agent host):

BoKS # cadm -l -f passwd [-h host] | grep my-user | while read pwent; do user=`expr "$pwent" : '\([^:][^:]*\):'`; echo "$pwent" | mkbks -I TRUSTED && echo $user; done

Still have questions? We can help. Submit a case to Technical Support.

Last Modified On: May 25, 2018