| 
				
			 | 
			
			
				@@ -36,6 +36,8 @@ PEER_ID= 
			 | 
		
	
		
			
			| 
				36
			 | 
			
				36
			 | 
			
			
				 INSTALL_DIR=/root/build 
			 | 
		
	
		
			
			| 
				37
			 | 
			
				37
			 | 
			
			
				 INSTALL_LOG=/var/log/${PROJECT_NAME}.log 
			 | 
		
	
		
			
			| 
				38
			 | 
			
				38
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				
			 | 
			
				39
			 | 
			
			
				+DEFAULT_USERNAME=fbone 
			 | 
		
	
		
			
			| 
				
			 | 
			
				40
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				39
			 | 
			
				41
			 | 
			
			
				 TOX_NODES= 
			 | 
		
	
		
			
			| 
				40
			 | 
			
				42
			 | 
			
			
				 #TOX_NODES=( 
			 | 
		
	
		
			
			| 
				41
			 | 
			
				43
			 | 
			
			
				 #  '192.254.75.102,2607:5600:284::2,33445,951C88B7E75C867418ACDB5D273821372BB5BD652740BCDF623A4FA293E75D2F,Tox RELENG,US' 
			 | 
		
	
	
		
			
			| 
				
			 | 
			
			
				@@ -506,6 +508,26 @@ function configure_toxcore { 
			 | 
		
	
		
			
			| 
				506
			 | 
			
				508
			 | 
			
			
				 	echo $'toxic client configured' >> $INSTALL_LOG 
			 | 
		
	
		
			
			| 
				507
			 | 
			
				509
			 | 
			
			
				 } 
			 | 
		
	
		
			
			| 
				508
			 | 
			
				510
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				
			 | 
			
				511
			 | 
			
			
				+function disable_password_logins { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				512
			 | 
			
			
				+	if [ ! -d /home/$DEFAULT_USERNAME ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				513
			 | 
			
			
				+		echo $"Home directory for $DEFAULT_USERNAME not found" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				514
			 | 
			
			
				+		exit 3682572 
			 | 
		
	
		
			
			| 
				
			 | 
			
				515
			 | 
			
			
				+	fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				516
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				517
			 | 
			
			
				+	# create an authorized_keys file 
			 | 
		
	
		
			
			| 
				
			 | 
			
				518
			 | 
			
			
				+	if [ ! -d /home/$DEFAULT_USERNAME/.ssh ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				519
			 | 
			
			
				+		mkdir -p /home/$DEFAULT_USERNAME/.ssh 
			 | 
		
	
		
			
			| 
				
			 | 
			
				520
			 | 
			
			
				+	fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				521
			 | 
			
			
				+	if [ ! -f /home/$DEFAULT_USERNAME/.ssh/authorized_keys ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				522
			 | 
			
			
				+		touch /home/$DEFAULT_USERNAME/.ssh/authorized_keys 
			 | 
		
	
		
			
			| 
				
			 | 
			
				523
			 | 
			
			
				+	fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				524
			 | 
			
			
				+	chown -R $DEFAULT_USERNAME:$DEFAULT_USERNAME /home/$DEFAULT_USERNAME/.ssh 
			 | 
		
	
		
			
			| 
				
			 | 
			
				525
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				526
			 | 
			
			
				+	# disable password logins 
			 | 
		
	
		
			
			| 
				
			 | 
			
				527
			 | 
			
			
				+	sed -i 's|#PasswordAuthentication.*|PasswordAuthentication no|g' /etc/ssh/sshd_config 
			 | 
		
	
		
			
			| 
				
			 | 
			
				528
			 | 
			
			
				+	sed -i 's|PasswordAuthentication.*|PasswordAuthentication no|g' /etc/ssh/sshd_config 
			 | 
		
	
		
			
			| 
				
			 | 
			
				529
			 | 
			
			
				+} 
			 | 
		
	
		
			
			| 
				
			 | 
			
				530
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				509
			 | 
			
				531
			 | 
			
			
				 if [ -f /root/.initial_mesh_setup ]; then 
			 | 
		
	
		
			
			| 
				510
			 | 
			
				532
			 | 
			
			
				 	if [ $1 ]; then 
			 | 
		
	
		
			
			| 
				511
			 | 
			
				533
			 | 
			
			
				 		MY_USERNAME=$1 
			 | 
		
	
	
		
			
			| 
				
			 | 
			
			
				@@ -530,6 +552,7 @@ if [ -f /root/.initial_mesh_setup ]; then 
			 | 
		
	
		
			
			| 
				530
			 | 
			
				552
			 | 
			
			
				 	#compile_tox_client 
			 | 
		
	
		
			
			| 
				531
			 | 
			
				553
			 | 
			
			
				 	configure_toxcore 
			 | 
		
	
		
			
			| 
				532
			 | 
			
				554
			 | 
			
			
				 	configure_zeronet 
			 | 
		
	
		
			
			| 
				
			 | 
			
				555
			 | 
			
			
				+	disable_password_logins 
			 | 
		
	
		
			
			| 
				533
			 | 
			
				556
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				534
			 | 
			
				557
			 | 
			
			
				 	rm /root/.initial_mesh_setup 
			 | 
		
	
		
			
			| 
				535
			 | 
			
				558
			 | 
			
			
				 	systemctl disable mesh-setup.service 
			 |