3 * Change user's SSH authorized keys
5 * Copyright 1999-2001 (c) VA Linux Systems
9 * This file is part of GForge.
11 * GForge is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * GForge is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with GForge; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 require_once('pre.php');
27 require_once('common/include/account.php');
29 session_require(array('isloggedin'=>1));
30 $u =& user_get_object(user_getid());
31 if (!$u || !is_object($u)) {
32 exit_error('Error','Could Not Get User');
33 } elseif ($u->isError()) {
34 exit_error('Error',$u->getErrorMessage());
38 if (!$u->setAuthorizedKeys($authorized_keys)) {
41 'Could not update SSH authorized keys: '.db_error()
44 session_redirect("/account/");
47 // not valid registration, or first time to page
48 site_user_header(array('title'=>'Change Authorized Keys'));
53 To avoid having to type your password every time for your CVS/SSH
54 developer account, you may upload your public key(s) here and they
55 will be placed on the CVS server in your ~/.ssh/authorized_keys file.
56 This is done by a cron job, so it may not happen immediately. Please allow
60 To generate a public key, run the program 'ssh-keygen' (you can use
61 both protocol 1 or 2). The public key will be placed at
62 '~/.ssh/identity.pub' (protocole 1) and '~/.ssh/id_dsa.pub' or
63 '~/.ssh/id_rsa.pub' (protocole 2). Read the ssh documentation for
64 further information on sharing keys.
67 <form action="<?php echo $PHP_SELF; ?>" method="post">
69 <br /><em>Important: Make sure there are no line breaks except between keys.
70 After submitting, verify that the number of keys in your file is what you expected.</em>
72 <textarea rows="10" cols="60" name="authorized_keys">
73 <?php echo $u->getAuthorizedKeys(); ?>
75 <p><input type="submit" name="submit" value="Update" /></p>
80 site_user_footer(array());