2007-08-14

Passwordless Unix Login

Create a key pair

mack:~ reedobrien$ ssh-keygen -t rsa -f ~/.ssh/id_rsa
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /Users/reedobrien/.ssh/id_rsa.
Your public key has been saved in /Users/reedobrien/.ssh/id_rsa.pub.
The key fingerprint is:
bd:6c:18:e3:1a:46:5f:3d:d9:95:ed:82:6b:ea:6b:ec

Add the public Key to the server where you want to authenticate

mack:~ reedobrien$ scp ~/.ssh/id_rsa.pub username@remoteserver:~/.ssh/id_rsa.pub
mack:~ reedobrien$ ssh -l username remoteserver
password: ********
remoteserver:~ username$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
remoteserver:~ username$ exit

NOTE: There are many more advanced features, configurations, identity management things that can be done not covered here.

Test


mack:~ reedobrien$ ssh -l robrien remoteserver
Last login: Mon Aug 13 22:28:10 2007 from 131.182.85.5
Welcome to A Better World!
remoteserver:~ robrien$

2007-08-02

ipython in zope3 zopectl debug

The solution in my earlier post doesn't fly in zope3. To get it to work in zope3 I modified:
~/instances/z3/bin/debugzope


if __name__ == '__main__':    db = startup()
del startup
from zope.app.debug import Debugger
debugger = app = Debugger.fromDatabase(db)
root = app.root()
del db
del Debugger
import IPython
IPython.Shell.IPShell(user_ns={'root': root,
'app': app,
'top' : app.root()
}).mainloop(sys_exit=1)


I haven't figured out much about how the debugger differs in Zope3. But it gives me top as app.root().




In [1]: print top.items()
<OOBTreeItems object at 0x355c598>

In [2]: app.root()['foo']
Out[2]: <zope.app.folder.folder.Folder object at 0x36dfef0>

In [3]: top
Out[3]: <zope.app.folder.folder.Folder object at 0x36a27f0>

In [4]: top['foo']
Out[4]: <zope.app.folder.folder.Folder object at 0x36df830>

In [5]: print [x for x in top.items()]
[(u'foo', <zope.app.folder.folder.Folder object at 0x36df830>)]