Skip to content

Instantly share code, notes, and snippets.

@guileen
Created April 9, 2012 07:44
Show Gist options
  • Save guileen/2342185 to your computer and use it in GitHub Desktop.
Save guileen/2342185 to your computer and use it in GitHub Desktop.
init user settings
#!/bin/bash
read -p "Please input username:" USERNAME
if [ ! -f "/bin/zsh" ]; then
apt-get install zsh
fi
useradd -U -s /bin/zsh -m $USERNAME
passwd $USERNAME
# to modify group
# usermod -a -G group1,group2,group3 username
# to show groups
# groups username
cat <<'EOF' > /home/$USERNAME/.zshrc
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
bindkey -v
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
zstyle :compinstall filename '/home/$USERNAME/.zshrc'
autoload -Uz compinit
compinit
# End of lines added by compinstall
PROMPT="%{$fg[green]%}%n%{$reset_color%}@%{$fg[blue]%}%m%{$reset_color%} %1~>"
RPROMPT="%{$fg[blue]%}%~%{$reset_color%} %{$fg[green]%}[%?]%{$reset_color%}%{$fg[blue]%}%T%{$reset_color%}"
alias rm='rm -i'
alias ls='ls --color'
alias wget='axel'
EDITOR=vim
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment