Difference between revisions of "Create system user"
From SME Server
Jump to navigationJump to search (Created page with "{{Level|Developer}} ==Create system user== a routine exists in /sbin/e-smith/ to create easily sytem users (different of user registered in LDAP) * usage # /sbin/e-smith/cr...") |
|||
Line 11: | Line 11: | ||
/sbin/e-smith/create-system-user dns 53 "Name server" /var/service/tinydns /bin/false | /sbin/e-smith/create-system-user dns 53 "Name server" /var/service/tinydns /bin/false | ||
/sbin/e-smith/create-system-user dnslog 411 "DNS log user" /var/log /bin/false | /sbin/e-smith/create-system-user dnslog 411 "DNS log user" /var/log /bin/false | ||
+ | |||
+ | |||
+ | |||
+ | ===Create a user in %prep=== | ||
+ | that could be done also like this in a spec file or by the command line | ||
+ | |||
+ | %pre | ||
+ | if [ `grep -c ^user /etc/passwd` = "0" ]; then | ||
+ | /usr/sbin/useradd -c 'User Comment' -d /path/to/user/home -p 'encrypted password' -s /bin/bash user | ||
+ | fi |
Revision as of 08:01, 16 August 2015
Create system user
a routine exists in /sbin/e-smith/ to create easily sytem users (different of user registered in LDAP)
- usage
# /sbin/e-smith/create-system-user Must give username param Usage: /sbin/e-smith/create-system-user: user userid descr home_dir shell
- example
/sbin/e-smith/create-system-user dns 53 "Name server" /var/service/tinydns /bin/false /sbin/e-smith/create-system-user dnslog 411 "DNS log user" /var/log /bin/false
Create a user in %prep
that could be done also like this in a spec file or by the command line
%pre if [ `grep -c ^user /etc/passwd` = "0" ]; then /usr/sbin/useradd -c 'User Comment' -d /path/to/user/home -p 'encrypted password' -s /bin/bash user fi