/[adm]/puppet/modules/buildsystem/templates/mgacreatehome
ViewVC logotype

Contents of /puppet/modules/buildsystem/templates/mgacreatehome

Parent Directory Parent Directory | Revision Log Revision Log


Revision 696 - (show annotations) (download)
Fri Jan 7 13:26:08 2011 UTC (13 years, 3 months ago) by boklm
File size: 635 byte(s)
add script to help adding ssh keys
1 #!/bin/sh
2
3 # script to create home directory with ssh key
4 # takes two arguments :
5 # - login
6 # - URL for ssh key
7
8 test $# -eq 2 || exit 1
9 login="$1"
10 sshkeyurl="$2"
11 sshkeyfile=`mktemp`
12 homeroot='/home'
13
14 id "$login" || exit 2
15 wget -O "$sshkeyfile" "$sshkeyurl" || exit 2
16 cat "$sshkeyfile"
17 echo "Press enter to validate"
18 read z
19
20 test ! -d "$homeroot/$login" && cp -a /etc/skel "$homeroot/$login"
21 mkdir "$homeroot/$login/.ssh"
22 cat "$sshkeyfile" >> "$homeroot/$login/.ssh/authorized_keys"
23 rm -f "$sshkeyfile"
24 chmod 700 "$homeroot/$login/.ssh"
25 chmod 600 "$homeroot/$login/.ssh/authorized_keys"
26 chown -R "$login":mga-users "$homeroot/$login"
27

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.30