u
This commit is contained in:
		
							parent
							
								
									c416a23821
								
							
						
					
					
						commit
						47f6ace177
					
				| @ -42,7 +42,7 @@ echo "=== Configure root home" | |||||||
| source /faronear/fon/sysconfig/home-config.sh /faronear/fon/sysconfig/nixhome | source /faronear/fon/sysconfig/home-config.sh /faronear/fon/sysconfig/nixhome | ||||||
| echo | echo | ||||||
| 
 | 
 | ||||||
| echo "=== Change root password? <y> for yes, anything else for omit:" | echo "=== Change root password? <y> for yes, <anything else> for omit:" | ||||||
| read -p ">>> " ChangeRootPassword | read -p ">>> " ChangeRootPassword | ||||||
| if [ "$ChangeRootPassword" == 'y' ] | if [ "$ChangeRootPassword" == 'y' ] | ||||||
| then | then | ||||||
| @ -51,10 +51,15 @@ fi | |||||||
| echo  | echo  | ||||||
| 
 | 
 | ||||||
| echo "=== Configure /etc/sudoers: includedir /etc/sudoers.d" | echo "=== Configure /etc/sudoers: includedir /etc/sudoers.d" | ||||||
| chmod o+w /etc/sudoers |  | ||||||
| #sed -i "s|%sudo\s\+ALL=(ALL:ALL)\sALL|%sudo\tALL=(ALL:ALL) NOPASSWD:ALL|g" /etc/sudoers  # allow all users in %sudo group to sudo without password | #sed -i "s|%sudo\s\+ALL=(ALL:ALL)\sALL|%sudo\tALL=(ALL:ALL) NOPASSWD:ALL|g" /etc/sudoers  # allow all users in %sudo group to sudo without password | ||||||
| sed -i "s|#includedir /etc/sudoers.d|@includedir /etc/sudoers.d|g" /etc/sudoers  # allow users in /etc/sudoers.d/ folder to sudo | DebianVersionMain=`cat /etc/debian_version | sed -r 's/^([0-9]+)\..*$/\1/'` | ||||||
| chmod o-w /etc/sudoers | if [ "$DebianVersionMain" == '10' ] | ||||||
|  | then | ||||||
|  |   chmod o+w /etc/sudoers | ||||||
|  |   ## Debian 10 上,不存在 @includedir,需要自己添加。而 Debian 11.1 上,已经存在 @includedir | ||||||
|  |   sed -i "s|#includedir /etc/sudoers.d|includedir /etc/sudoers.d|g" /etc/sudoers  # allow users in /etc/sudoers.d/ folder to sudo | ||||||
|  |   chmod o-w /etc/sudoers | ||||||
|  | fi | ||||||
| echo | echo | ||||||
| 
 | 
 | ||||||
| echo "=== Disallow root login: #PermitRootLogin yes" | echo "=== Disallow root login: #PermitRootLogin yes" | ||||||
| @ -96,7 +101,7 @@ read -p ">>> " ConfigLocales | |||||||
| if [ "$ConfigLocales" == 'y' ] | if [ "$ConfigLocales" == 'y' ] | ||||||
| then | then | ||||||
|   dpkg-reconfigure locales |   dpkg-reconfigure locales | ||||||
| else | fi | ||||||
| echo | echo | ||||||
| 
 | 
 | ||||||
| echo "=== Add a new user $NewUser" | echo "=== Add a new user $NewUser" | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user