PermitRootLogin yes should go to /etc/ssh/sshd_config
This commit is contained in:
		
					parent
					
						
							
								a994b4cf1a
							
						
					
				
			
			
				commit
				
					
						d7ada99c7a
					
				
			
		
					 1 changed files with 3 additions and 2 deletions
				
			
		|  | @ -16,6 +16,7 @@ rdnssd -u root -r /etc/resolv.conf | ||||||
| 
 | 
 | ||||||
| ssh_authorized_keys_path='/root/.ssh/authorized_keys' | ssh_authorized_keys_path='/root/.ssh/authorized_keys' | ||||||
| ssh_config_path='/etc/ssh/ssh_config' | ssh_config_path='/etc/ssh/ssh_config' | ||||||
|  | sshd_config_path='/etc/ssh/sshd_config' | ||||||
| # Initial Package Intallation | # Initial Package Intallation | ||||||
| if [ [ $(get_distro) = "alpine" ]; then | if [ [ $(get_distro) = "alpine" ]; then | ||||||
| 	apk update | 	apk update | ||||||
|  | @ -26,8 +27,8 @@ if [ [ $(get_distro) = "alpine" ]; then | ||||||
| 		echo "PasswordAuthentication no" >> $ssh_config_path | 		echo "PasswordAuthentication no" >> $ssh_config_path | ||||||
| 	fi | 	fi | ||||||
| 	 | 	 | ||||||
| 	if ! grep -q "PermitRootLogin yes" $ssh_config_path; then | 	if ! grep -q "PermitRootLogin yes" $sshd_config_path; then | ||||||
| 		echo "PermitRootLogin yes" >> $ssh_config_path | 		echo "PermitRootLogin yes" >> $sshd_config_path | ||||||
| 	fi | 	fi | ||||||
| 	service sshd restart | 	service sshd restart | ||||||
| else | else | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue