Browse Source

zsh, adduser/useradd, phpmyadmin updates

Nathaniel van Diepen 9 years ago
parent
commit
0fd2113b4c
4 changed files with 136 additions and 3 deletions
  1. 85 0
      data/etc/adduser.conf
  2. 37 0
      data/etc/default/useradd
  3. 1 1
      data/var/www/phpmyadmin/config.inc.php
  4. 13 2
      install.sh

+ 85 - 0
data/etc/adduser.conf

@@ -0,0 +1,85 @@
+# /etc/adduser.conf: `adduser' configuration.
+# See adduser(8) and adduser.conf(5) for full documentation.
+
+# The DSHELL variable specifies the default login shell on your
+# system.
+DSHELL=/bin/zsh
+
+# The DHOME variable specifies the directory containing users' home
+# directories.
+DHOME=/home
+
+# If GROUPHOMES is "yes", then the home directories will be created as
+# /home/groupname/user.
+GROUPHOMES=no
+
+# If LETTERHOMES is "yes", then the created home directories will have
+# an extra directory - the first letter of the user name. For example:
+# /home/u/user.
+LETTERHOMES=no
+
+# The SKEL variable specifies the directory containing "skeletal" user
+# files; in other words, files such as a sample .profile that will be
+# copied to the new user's home directory when it is created.
+SKEL=/etc/skel
+
+# FIRST_SYSTEM_[GU]ID to LAST_SYSTEM_[GU]ID inclusive is the range for UIDs
+# for dynamically allocated administrative and system accounts/groups.
+# Please note that system software, such as the users allocated by the base-passwd
+# package, may assume that UIDs less than 100 are unallocated.
+FIRST_SYSTEM_UID=100
+LAST_SYSTEM_UID=999
+
+FIRST_SYSTEM_GID=100
+LAST_SYSTEM_GID=999
+
+# FIRST_[GU]ID to LAST_[GU]ID inclusive is the range of UIDs of dynamically
+# allocated user accounts/groups.
+FIRST_UID=1000
+LAST_UID=29999
+
+FIRST_GID=1000
+LAST_GID=29999
+
+# The USERGROUPS variable can be either "yes" or "no".  If "yes" each
+# created user will be given their own group to use as a default.  If
+# "no", each created user will be placed in the group whose gid is
+# USERS_GID (see below).
+USERGROUPS=yes
+
+# If USERGROUPS is "no", then USERS_GID should be the GID of the group
+# `users' (or the equivalent group) on your system.
+USERS_GID=100
+
+# If DIR_MODE is set, directories will be created with the specified
+# mode. Otherwise the default mode 0755 will be used.
+DIR_MODE=0755
+
+# If SETGID_HOME is "yes" home directories for users with their own
+# group the setgid bit will be set. This was the default for
+# versions << 3.13 of adduser. Because it has some bad side effects we
+# no longer do this per default. If you want it nevertheless you can
+# still set it here.
+SETGID_HOME=no
+
+# If QUOTAUSER is set, a default quota will be set from that user with
+# `edquota -p QUOTAUSER newuser'
+QUOTAUSER=""
+
+# If SKEL_IGNORE_REGEX is set, adduser will ignore files matching this
+# regular expression when creating a new home directory
+SKEL_IGNORE_REGEX="dpkg-(old|new|dist|save)"
+
+# Set this if you want the --add_extra_groups option to adduser to add
+# new users to other groups.
+# This is the list of groups that new non-system users will be added to
+# Default:
+#EXTRA_GROUPS="dialout cdrom floppy audio video plugdev users"
+
+# If ADD_EXTRA_GROUPS is set to something non-zero, the EXTRA_GROUPS
+# option above will be default behavior for adding new, non-system users
+#ADD_EXTRA_GROUPS=1
+
+
+# check user and group names also against this regular expression.
+#NAME_REGEX="^[a-z][-a-z0-9_]*\$"

+ 37 - 0
data/etc/default/useradd

@@ -0,0 +1,37 @@
+# Default values for useradd(8)
+#
+# The SHELL variable specifies the default login shell on your
+# system.
+# Similar to DHSELL in adduser. However, we use "sh" here because
+# useradd is a low level utility and should be as general
+# as possible
+SHELL=/bin/zsh
+#
+# The default group for users
+# 100=users on Debian systems
+# Same as USERS_GID in adduser
+# This argument is used when the -n flag is specified.
+# The default behavior (when -n and -g are not specified) is to create a
+# primary user group with the same name as the user being added to the
+# system.
+# GROUP=100
+#
+# The default home directory. Same as DHOME for adduser
+# HOME=/home
+#
+# The number of days after a password expires until the account 
+# is permanently disabled
+# INACTIVE=-1
+#
+# The default expire date
+# EXPIRE=
+#
+# The SKEL variable specifies the directory containing "skeletal" user
+# files; in other words, files such as a sample .profile that will be
+# copied to the new user's home directory when it is created.
+# SKEL=/etc/skel
+#
+# Defines whether the mail spool should be created while
+# creating the account
+# CREATE_MAIL_SPOOL=yes
+

+ 1 - 1
data/var/www/phpmyadmin/config.inc.php

@@ -14,7 +14,7 @@
 	$cfg['Servers'][$i]['ssl'] = true;
 	$cfg['Servers'][$i]['user'] = 'root';
 	$cfg['Servers'][$i]['password'] = '';
-	$cfg['Servers'][$i]['pmadb'] = true;
+	$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
 	$cfg['Servers'][$i]['relation'] = 'pma__relation';
 	$cfg['Servers'][$i]['table_info'] = 'pma__table_info';
 	$cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';

+ 13 - 2
install.sh

@@ -94,6 +94,8 @@ log "Git";
 install git;
 log "htop";
 install htop;
+log "zsh";
+install zsh;
 
 section "Custom Packages";
 log "Omnimaga-Server-Utils";
@@ -121,15 +123,16 @@ chown www-data:www-data /var/www/phpmyadmin -R;
 log "omnimaga";
 
 section "Config";
-log "Setting up sudoers";
+log "Sudoers";
 updatesudo sudoers;
-log "Setting up groups";
+log "Groups";
 sublog "web";
 groupadd -f web;
 updatesudo sudoers.d/web;
 sublog "ircd";
 groupadd -f ircd;
 updatesudo sudoers.d/ircd;
+log "Services";
 sublog "mysqld";
 cp data/etc/mysql/conf.d/replication.cnf /etc/mysql/conf.d/replication.cnf;
 service mysql reload;
@@ -139,6 +142,14 @@ a2enmod -q rewrite;
 site omnimaga;
 site pma;
 service apache2 reload;
+log "Core";
+sublog "shell";
+cp data/etc/adduser.conf /etc/adduser.conf;
+cp data/etc/default/useradd /etc/default/useradd;
+grep -v nologin /etc/passwd | grep -v /bin/false | grep -v /bin/sync | grep -v /var/lib/libuuid | cut -d : -f 1 | while read user;do
+	chsh -s /bin/zsh $user;
+	info "Changed shell for $user";
+done;
 sublog "hosts";
 host omnimaga.org;
 host www.omnimaga.org;