u
This commit is contained in:
		
							parent
							
								
									12555bb1cb
								
							
						
					
					
						commit
						05cbd0edf9
					
				
							
								
								
									
										10
									
								
								.bashrc
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								.bashrc
									
									
									
									
									
								
							| @ -11,7 +11,8 @@ | ||||
| # User specific aliases and functions | ||||
| 
 | ||||
| # Execute system startup script: | ||||
| if [ -f /etc/bashrc ]; then | ||||
| if [ -f /etc/bashrc ] | ||||
| then | ||||
| 	. /etc/bashrc | ||||
| fi | ||||
| 
 | ||||
| @ -26,14 +27,13 @@ export CVS_RSH=ssh | ||||
| # 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. | ||||
| # Note 2: Add current directory to PATH is dangerous! | ||||
| #if [ -e ~/bin/addpath.sh ]  | ||||
| #  then  | ||||
| #if [ -e ~/bin/addpath.sh ]  then  | ||||
| #    . ~/bin/addpath.sh ~/bin | ||||
| #fi | ||||
| 
 | ||||
| # Define aliases: | ||||
| # Always list long directory and time. | ||||
| if [ uname | grep 'Darwin' ] | ||||
| if uname | grep 'Darwin'; | ||||
| then | ||||
|   alias l='ls -lG' | ||||
|   alias ll='ls -lGA' # show .xxx  | ||||
| @ -42,6 +42,7 @@ else | ||||
|   alias l='ls -l --color=auto' # --time-style=long-iso --color=auto' | ||||
|   alias ll='ls -lA --color=auto' | ||||
|   alias lll='ls -la --color=auto' | ||||
|   alias emacs='emacs -nw' | ||||
| fi | ||||
| #export LS_OPTIONS='--color=auto' # 如果没有指定,则自动选择颜色 | ||||
| #export CLICOLOR='Yes'            #是否输出颜色 | ||||
| @ -55,7 +56,6 @@ alias ssh='ssh -C -X' | ||||
| alias cvs='cvs -z9' | ||||
| 
 | ||||
| alias ps='ps -elf' | ||||
| alias emacsnw='emacs -nw' | ||||
| 
 | ||||
| # Set default file permission mask: | ||||
| umask 022 # rwxr-xr-x | ||||
|  | ||||
| @ -37,14 +37,14 @@ passwd | ||||
| 
 | ||||
| echo ">>> Add a new user" | ||||
| useradd $User | ||||
| # usermod -a -G sudo $User # 允许该账号进行 sudo 来访问关键资源 | ||||
| # usermod -a -G sudo $User # Add to sudo group | ||||
| passwd $User | ||||
| mkdir /home/$User | ||||
| chown $User:$User /home/$User | ||||
| # 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 | ||||
| # Debian 9 默认为空。 | ||||
| # Debian 9 default to empty | ||||
| sed -i "s/\/home\/$User:$/\/home\/$User:\/bin\/bash/g" /etc/passwd | ||||
| 
 | ||||
| echo ">>> Allow sudo without password: %sudo ALL=(ALL:ALL) NOPASSWD:ALL" | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user