Add commands to create backuppc user
This commit is contained in:
		
							parent
							
								
									8bf3031d51
								
							
						
					
					
						commit
						eb33666a92
					
				|  | @ -245,9 +245,6 @@ if [ "$?" != "$SUCCESS" ]; then | |||
| 	printf '\e[1;31m%-6s\e[m' "Clé inaccessible, merci de contacter votre administrateur réseau, installation annulée."; exit | ||||
| fi | ||||
| 
 | ||||
| #### AUTORISER L'UTILISATEUR À SE CONNECTER VIA SSH #### | ||||
| allowUserToConnectToThisMachineUsingSsh "${usr}" | ||||
| 
 | ||||
| #### CRÉATION DU FICHIER DE CONFIGURATION #### | ||||
| fqdn="$(MyFqdn)" | ||||
| filepl="${fqdn}.pl" | ||||
|  | @ -279,27 +276,21 @@ echo "# username:${usr}" >> "${filepl}" | |||
| #### Déplacer le fichier dans le dossier de l'utilisateur (plus accessible) | ||||
| mv "${filepl}" "${dir1}" | ||||
| 
 | ||||
| #### AJOUTER LES DROITS EN LECTURE POUR LE GROUPE #### | ||||
| # printf '\e[1;34m%-6s\e[m' "Ajout des droits en lecture pour le groupe sur les dossiers à sauvegarder (patience !)…" | ||||
| # printf "\n" | ||||
| # for dir in "${dir1}" "${input_dir2}"; do | ||||
| #   find "${dir}" \( ! -regex '.*/\..*' \) -type f -exec chmod g+r {} \; | ||||
| #   find "${dir}" \( ! -regex '.*/\..*' \) -type d -exec chmod g+rx {} \; | ||||
| # done | ||||
| 
 | ||||
| #### AUTORISER LES CONNEXIONS AU COMPTE UTILISATEUR #### | ||||
| homeuser=$(eval echo ~"${usr}") | ||||
| printf '\e[1;34m%-6s\e[m' "Autorisation de connexion au compte via SSH…" | ||||
| printf "\n" | ||||
| mkdir -p -- "${homeuser}"/.ssh | ||||
| echo "from=\"129.20.203.16\" ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDIhMc8ixQXfWDACJy4q0v8T877UxahhCjO51PQFzylwVpf88LX3yWeDrWIW0NRu0zoSm396mig918OpD5ggqML/QbYbQsoDdAFUV/tK4JU6UJgEQIl25MOcUBCFepsFBGS09CH/V07xSUqSP/+beeTRLNO2CQzk3S2y3YfkXpM7KmOGfeLgoCaQAcxIkgLXeM3TpCZEzJDlZ8c8k/DjVvsgwCpQktYzNo2b37KHLLfgyW9KSo6N9sReUuNQjS6lu8rjrXfc6+J0pY2D6IxWptTWL/JVrhFCUqe4QQy+xYjoR41wqnAQyl/kOcyBNhSvojMKwQT6vlPwru6pOno16/X backuppc@backuppc.ipr.univ-rennes1.fr" >> "${homeuser}"/.ssh/authorized_keys | ||||
| chown -R "${usr}" "${homeuser}"/.ssh/ | ||||
| #### CRÉATION DE L’UTILISATEUR BACKUPPC #### | ||||
| printf '\e[1;34m%-6s\e[m\n' "Création du compte backuppc…" | ||||
| homebackuppc='/var/lib/backuppc' | ||||
| AddUserBackuppc "${input_login}" "${homebackuppc}" | ||||
| #mkdir -p -- "${homebackuppc}"/.ssh | ||||
| printf '\e[1;31m%-6s\e[m\n' "DEBUG : Création du répertoire .ssh de l'utilisateur : ${homebackuppc}/.ssh" | ||||
| #echo "from=\"129.20.203.16\" ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDIhMc8ixQXfWDACJy4q0v8T877UxahhCjO51PQFzylwVpf88LX3yWeDrWIW0NRu0zoSm396mig918OpD5ggqML/QbYbQsoDdAFUV/tK4JU6UJgEQIl25MOcUBCFepsFBGS09CH/V07xSUqSP/+beeTRLNO2CQzk3S2y3YfkXpM7KmOGfeLgoCaQAcxIkgLXeM3TpCZEzJDlZ8c8k/DjVvsgwCpQktYzNo2b37KHLLfgyW9KSo6N9sReUuNQjS6lu8rjrXfc6+J0pY2D6IxWptTWL/JVrhFCUqe4QQy+xYjoR41wqnAQyl/kOcyBNhSvojMKwQT6vlPwru6pOno16/X backuppc@backuppc.ipr.univ-rennes1.fr" > "${homebackuppc}"/.ssh/authorized_keys | ||||
| printf '\e[1;31m%-6s\e[m\n' "DEBUG : Ajout de la clef SSH du server dans "${homebackuppc}"/.ssh/authorized_keys." | ||||
| #chown -R backuppc "${homebackuppc}"/.ssh/ | ||||
| printf '\e[1;31m%-6s\e[m\n' "DEBUG : chown -R backuppc ${homebackuppc}/.ssh/" | ||||
| 
 | ||||
| 
 | ||||
| #### END #### | ||||
| printf "\n" | ||||
| printf '\e[1;34m%-6s\e[m' "Configuration du poste terminée." | ||||
| printf '\e[1;34m%-6s\e[m' "Envoyez bien votre fichier de configuration (${dir1}/${filepl}) à Jérémy GARDAIS (jeremy.gardai@univ-rennes1.fr)." | ||||
| printf "\n" | ||||
| printf '\e[1;34m%-6s\e[m' "Vous pourrez affiner la configuration de votre sauvegarde depuis https://backuppc.ipr.univ-rennes1.fr" | ||||
| printf '\e[1;34m%-6s\e[m\n' "Configuration du poste terminée." | ||||
| printf '\e[1;34m%-6s\e[m\n' "Envoyez bien votre fichier de configuration (${dir1}/${filepl}) à Jérémy GARDAIS (jeremy.gardai@univ-rennes1.fr)." | ||||
| printf "\n" | ||||
| printf '\e[1;34m%-6s\e[m\n' "Vous pourrez affiner la configuration de votre sauvegarde depuis https://backuppc.ipr.univ-rennes1.fr" | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue