Author: Eric S. Raymond <esr@thyrsus.com>"""
-# $Id: ssh-installkeys,v 1.17 2004/03/11 23:19:16 esr Exp esr $
+# $Id: ssh-installkeys,v 1.18 2004/06/21 12:53:48 esr Exp esr $
import os, sys, getopt, string, getpass, tempfile
Currently pexpect is intended for UNIX operating systems (including OS-X)."""
__version__ = '0.94'
-__revision__ = '$Revision: 1.17 $'
+__revision__ = '$Revision: 1.18 $'
__all__ = ['ExceptionPexpect', 'EOF', 'TIMEOUT', 'spawn',
'__version__', '__revision__']
except:
die("Can't find your home directory!")
if not os.access(".", os.R_OK):
- die("Your home directory is not readable by you. That's weird.")
+ print "Your home directory is not readable by you. That's weird."
die("This probably means $HOME is incorrect.")
if not os.path.exists(".ssh"):
print "You have no .ssh directory."
- if check:
+ if not check:
print "Creating your .ssh directory."
os.mkdir(".ssh")
else:
print "Creation of .ssh suppressed."
if not os.access(".ssh", os.R_OK):
- die("Your .ssh directory is not readable by you. That's weird.")
+ print "Your .ssh directory is not readable by you. That's weird."
die("This probabably means $HOME is incorrect.")
try:
os.chdir(".ssh")
# OK, install keys remotely if they don't exist
if not check and not session.exists("~/.ssh/authorized_keys"):
+ print "Copying your authorized_keys file to", host
session.scp(keyfile, "~/.ssh/authorized_keys")
except SystemExit:
pass