Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 496342
Collapse All | Expand All

(-)a/munin-2.0.19.ebuild (-6 / +18 lines)
Lines 339-353 Link Here
339
	einfo "Press enter to set up the SSH keys used for SSH transport"
339
	einfo "Press enter to set up the SSH keys used for SSH transport"
340
	read
340
	read
341
341
342
	# generate one rsa (for legacy) and one ecdsa (for new systems)
342
	# generate one rsa (for legacy systems)
343
	ssh-keygen -t rsa -f /var/lib/munin/.ssh/id_rsa -N '' -C "created by portage for ${CATEGORY}/${PN}" || die
343
	ssh-keygen -t rsa -f /var/lib/munin/.ssh/id_rsa -N '' -C "created by portage for ${CATEGORY}/${PN}" || die
344
	ssh-keygen -t ecdsa -f /var/lib/munin/.ssh/id_ecdsa -N '' -C "created by portage for ${CATEGORY}/${PN}" || die
344
	chmod 0600 /var/lib/munin/.ssh/id_rsa || die
345
346
	# generate one ecdsa (for new systems)
347
	ssh-keygen -t ecdsa -f /var/lib/munin/.ssh/id_ecdsa -N '' -C "created by portage for ${CATEGORY}/${PN}"
348
	if [[ "$?" -eq 0 ]]; then
349
		chmod 0600 /var/lib/munin/.ssh/id_ecdsa || die
350
	else
351
		ewarn "Failed to generate an ECDSA key"
352
		ewarn "Maybe you have net-misc/openssh[bindist]?"
353
		sed -i -e 's|\(.*/id_ecdsa\)|#\1|' /var/lib/munin/.ssh/config
354
	fi
355
345
	chown -R munin:munin /var/lib/munin/.ssh || die
356
	chown -R munin:munin /var/lib/munin/.ssh || die
346
	chmod 0600 /var/lib/munin/.ssh/id_{rsa,ecdsa} || die
347
357
348
	einfo "Your public keys are available in "
358
	einfo "Your public key(s) are available in "
349
	einfo "  /var/lib/munin/.ssh/id_rsa.pub"
359
	local PUBLIC_KEY
350
	einfo "  /var/lib/munin/.ssh/id_ecdsa.pub"
360
	for PUBLIC_KEY in /var/lib/munin/.ssh/id_*.pub; do
361
		einfo "  ${PUBLIC_KEY}"
362
	done
351
	einfo "and follows for convenience"
363
	einfo "and follows for convenience"
352
	echo
364
	echo
353
	cat /var/lib/munin/.ssh/id_*.pub
365
	cat /var/lib/munin/.ssh/id_*.pub

Return to bug 496342