1 |
# $Header: /home/cvsd/alx-cvs/alx-src/alxconfig-ng/functions/config_ssh_auth.sh,v 1.1 2005-04-14 19:13:04 niro Exp $ |
# $Header: /home/cvsd/alx-cvs/alx-src/alxconfig-ng/functions/config_ssh_auth.sh,v 1.3 2005-09-07 19:14:18 niro Exp $ |
2 |
# exchanges the public server and client ssh keys |
# exchanges the public server and client ssh keys |
3 |
|
|
4 |
gen_keys() { |
gen_keys() { |
23 |
|
|
24 |
config_ssh_auth() { |
config_ssh_auth() { |
25 |
|
|
26 |
|
local PUB_KEY_SERVER |
27 |
|
local ID |
28 |
|
|
29 |
# generate evtually missing keys |
# generate evtually missing keys |
30 |
gen_keys |
gen_keys |
31 |
|
|
35 |
|
|
36 |
if [ -n "${PUB_KEY_SERVER}" ] |
if [ -n "${PUB_KEY_SERVER}" ] |
37 |
then |
then |
38 |
|
HOME=/root |
39 |
# only if not empty |
# only if not empty |
40 |
[ ! -d $HOME/.ssh ] && install -d $HOME/.ssh |
[ ! -d $HOME/.ssh ] && install -d $HOME/.ssh |
41 |
echo "${PUB_KEY_SERVER}" > $HOME/.ssh/authorized_keys |
echo "${PUB_KEY_SERVER}" > $HOME/.ssh/authorized_keys |