1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Mageia-sysadm] [696] add script to help adding ssh keys
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:mageia-sysadm%40mageia.org?Subject=Re%3A%20%5BMageia-sysadm%5D%20%5B696%5D%20add%20script%20to%20help%20adding%20ssh%20keys&In-Reply-To=%3C20110107132608.D596041B71%40valstar.mageia.org%3E">
<META NAME="robots" CONTENT="index,nofollow">
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<LINK REL="Previous" HREF="001674.html">
<LINK REL="Next" HREF="001676.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Mageia-sysadm] [696] add script to help adding ssh keys</H1>
<B>root at mageia.org</B>
<A HREF="mailto:mageia-sysadm%40mageia.org?Subject=Re%3A%20%5BMageia-sysadm%5D%20%5B696%5D%20add%20script%20to%20help%20adding%20ssh%20keys&In-Reply-To=%3C20110107132608.D596041B71%40valstar.mageia.org%3E"
TITLE="[Mageia-sysadm] [696] add script to help adding ssh keys">root at mageia.org
</A><BR>
<I>Fri Jan 7 14:26:08 CET 2011</I>
<P><UL>
<LI>Previous message: <A HREF="001674.html">[Mageia-sysadm] Rebuild failed on x86_64 for @235:bash-4.1-6mga1.src.rpm
</A></li>
<LI>Next message: <A HREF="001676.html">[Mageia-sysadm] [697] disable lists for now as import is causing problems on other nodes
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#1675">[ date ]</a>
<a href="thread.html#1675">[ thread ]</a>
<a href="subject.html#1675">[ subject ]</a>
<a href="author.html#1675">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>Revision: 696
Author: boklm
Date: 2011-01-07 14:26:08 +0100 (Fri, 07 Jan 2011)
Log Message:
-----------
add script to help adding ssh keys
Modified Paths:
--------------
puppet/manifests/nodes.pp
puppet/modules/buildsystem/manifests/init.pp
Added Paths:
-----------
puppet/modules/buildsystem/templates/mgacreatehome
Modified: puppet/manifests/nodes.pp
===================================================================
--- puppet/manifests/nodes.pp 2011-01-07 02:46:13 UTC (rev 695)
+++ puppet/manifests/nodes.pp 2011-01-07 13:26:08 UTC (rev 696)
@@ -19,6 +19,7 @@
include ssh::auth
include ssh::auth::keymaster
include buildsystem::mainnode
+ include buildsystem::mgacreatehome
include pam::committers_access
include restrictshell::allow_svn
Modified: puppet/modules/buildsystem/manifests/init.pp
===================================================================
--- puppet/modules/buildsystem/manifests/init.pp 2011-01-07 02:46:13 UTC (rev 695)
+++ puppet/modules/buildsystem/manifests/init.pp 2011-01-07 13:26:08 UTC (rev 696)
@@ -241,4 +241,16 @@
content => template("buildsystem/sudoers.iurt")
}
}
+
+ # temporary script to create home dir with ssh key
+ # taking login and url as arguments
+ class mgacreatehome {
+ file { "/usr/local/sbin/mgacreatehome":
+ ensure => present,
+ owner => root,
+ group => root,
+ mode => 700,
+ content => template("buildsystem/mgacreatehome")
+ }
+ }
}
Added: puppet/modules/buildsystem/templates/mgacreatehome
===================================================================
--- puppet/modules/buildsystem/templates/mgacreatehome (rev 0)
+++ puppet/modules/buildsystem/templates/mgacreatehome 2011-01-07 13:26:08 UTC (rev 696)
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+# script to create home directory with ssh key
+# takes two arguments :
+# - login
+# - URL for ssh key
+
+test $# -eq 2 || exit 1
+login="$1"
+sshkeyurl="$2"
+sshkeyfile=`mktemp`
+homeroot='/home'
+
+id "$login" || exit 2
+wget -O "$sshkeyfile" "$sshkeyurl" || exit 2
+cat "$sshkeyfile"
+echo "Press enter to validate"
+read z
+
+test ! -d "$homeroot/$login" && cp -a /etc/skel "$homeroot/$login"
+mkdir "$homeroot/$login/.ssh"
+cat "$sshkeyfile" >> "$homeroot/$login/.ssh/authorized_keys"
+rm -f "$sshkeyfile"
+chmod 700 "$homeroot/$login/.ssh"
+chmod 600 "$homeroot/$login/.ssh/authorized_keys"
+chown -R "$login":mga-users "$homeroot/$login"
+
Property changes on: puppet/modules/buildsystem/templates/mgacreatehome
___________________________________________________________________
Added: svn:executable
+ *
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/mageia-sysadm/attachments/20110107/172d58d3/attachment-0001.html>
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="001674.html">[Mageia-sysadm] Rebuild failed on x86_64 for @235:bash-4.1-6mga1.src.rpm
</A></li>
<LI>Next message: <A HREF="001676.html">[Mageia-sysadm] [697] disable lists for now as import is causing problems on other nodes
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#1675">[ date ]</a>
<a href="thread.html#1675">[ thread ]</a>
<a href="subject.html#1675">[ subject ]</a>
<a href="author.html#1675">[ author ]</a>
</LI>
</UL>
<hr>
<a href="https://www.mageia.org/mailman/listinfo/mageia-sysadm">More information about the Mageia-sysadm
mailing list</a><br>
</body></html>
|