This commit is contained in:
陆柯 2019-12-13 20:04:22 +08:00
parent 12555bb1cb
commit 05cbd0edf9
2 changed files with 8 additions and 8 deletions

10
.bashrc
View File

@ -11,7 +11,8 @@
# User specific aliases and functions # User specific aliases and functions
# Execute system startup script: # Execute system startup script:
if [ -f /etc/bashrc ]; then if [ -f /etc/bashrc ]
then
. /etc/bashrc . /etc/bashrc
fi fi
@ -26,14 +27,13 @@ export CVS_RSH=ssh
# 1. it is defined in startup script, so every shell gets it! # 1. it is defined in startup script, so every shell gets it!
# 2. only shell needs this variable, other programs normally don't need it. # 2. only shell needs this variable, other programs normally don't need it.
# Note 2: Add current directory to PATH is dangerous! # Note 2: Add current directory to PATH is dangerous!
#if [ -e ~/bin/addpath.sh ] #if [ -e ~/bin/addpath.sh ] then
# then
# . ~/bin/addpath.sh ~/bin # . ~/bin/addpath.sh ~/bin
#fi #fi
# Define aliases: # Define aliases:
# Always list long directory and time. # Always list long directory and time.
if [ uname | grep 'Darwin' ] if uname | grep 'Darwin';
then then
alias l='ls -lG' alias l='ls -lG'
alias ll='ls -lGA' # show .xxx alias ll='ls -lGA' # show .xxx
@ -42,6 +42,7 @@ else
alias l='ls -l --color=auto' # --time-style=long-iso --color=auto' alias l='ls -l --color=auto' # --time-style=long-iso --color=auto'
alias ll='ls -lA --color=auto' alias ll='ls -lA --color=auto'
alias lll='ls -la --color=auto' alias lll='ls -la --color=auto'
alias emacs='emacs -nw'
fi fi
#export LS_OPTIONS='--color=auto' # 如果没有指定,则自动选择颜色 #export LS_OPTIONS='--color=auto' # 如果没有指定,则自动选择颜色
#export CLICOLOR='Yes' #是否输出颜色 #export CLICOLOR='Yes' #是否输出颜色
@ -55,7 +56,6 @@ alias ssh='ssh -C -X'
alias cvs='cvs -z9' alias cvs='cvs -z9'
alias ps='ps -elf' alias ps='ps -elf'
alias emacsnw='emacs -nw'
# Set default file permission mask: # Set default file permission mask:
umask 022 # rwxr-xr-x umask 022 # rwxr-xr-x

View File

@ -37,14 +37,14 @@ passwd
echo ">>> Add a new user" echo ">>> Add a new user"
useradd $User useradd $User
# usermod -a -G sudo $User # 允许该账号进行 sudo 来访问关键资源 # usermod -a -G sudo $User # Add to sudo group
passwd $User passwd $User
mkdir /home/$User mkdir /home/$User
chown $User:$User /home/$User chown $User:$User /home/$User
# emacs /etc/passwd # emacs /etc/passwd
# Debian 10 默认已经设了 /bin/sh # Debian 10 default to /bin/sh
sed -i "s/\/home\/$User:\/bin\/sh$/\/home\/$User:\/bin\/bash/g" /etc/passwd sed -i "s/\/home\/$User:\/bin\/sh$/\/home\/$User:\/bin\/bash/g" /etc/passwd
# Debian 9 默认为空。 # Debian 9 default to empty
sed -i "s/\/home\/$User:$/\/home\/$User:\/bin\/bash/g" /etc/passwd sed -i "s/\/home\/$User:$/\/home\/$User:\/bin\/bash/g" /etc/passwd
echo ">>> Allow sudo without password: %sudo ALL=(ALL:ALL) NOPASSWD:ALL" echo ">>> Allow sudo without password: %sudo ALL=(ALL:ALL) NOPASSWD:ALL"