Apache/2.4.7 (Ubuntu) Linux sman1baleendah 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) safemode : OFF MySQL: ON | Perl: ON | cURL: OFF | WGet: ON > / usr / lib / python2.7 / dist-packages / twisted / plugins / | server ip : 172.67.156.115 your ip : 172.70.127.162 H O M E |
Filename | /usr/lib/python2.7/dist-packages/twisted/plugins/cred_sshkeys.py |
Size | 1.41 kb |
Permission | rw-r--r-- |
Owner | root : root |
Create time | 27-Apr-2025 09:56 |
Last modified | 13-Mar-2012 05:35 |
Last accessed | 06-Jul-2025 17:16 |
Actions | edit | rename | delete | download (gzip) |
View | text | code | image |
# -*- test-case-name: twisted.test.test_strcred -*-
#
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Cred plugin for ssh key login
"""
from zope.interface import implements
from twisted import plugin
from twisted.cred.strcred import ICheckerFactory
from twisted.cred.credentials import ISSHPrivateKey
sshKeyCheckerFactoryHelp = """
This allows SSH public key authentication, based on public keys listed in
authorized_keys and authorized_keys2 files in user .ssh/ directories.
"""
try:
from twisted.conch.checkers import SSHPublicKeyDatabase
class SSHKeyCheckerFactory(object):
"""
Generates checkers that will authenticate a SSH public key
"""
implements(ICheckerFactory, plugin.IPlugin)
authType = 'sshkey'
authHelp = sshKeyCheckerFactoryHelp
argStringFormat = 'No argstring required.'
credentialInterfaces = SSHPublicKeyDatabase.credentialInterfaces
def generateChecker(self, argstring=''):
"""
This checker factory ignores the argument string. Everything
needed to authenticate users is pulled out of the public keys
listed in user .ssh/ directories.
"""
return SSHPublicKeyDatabase()
theSSHKeyCheckerFactory = SSHKeyCheckerFactory()
except ImportError:
# if checkers can't be imported, then there should be no SSH cred plugin
pass
#
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Cred plugin for ssh key login
"""
from zope.interface import implements
from twisted import plugin
from twisted.cred.strcred import ICheckerFactory
from twisted.cred.credentials import ISSHPrivateKey
sshKeyCheckerFactoryHelp = """
This allows SSH public key authentication, based on public keys listed in
authorized_keys and authorized_keys2 files in user .ssh/ directories.
"""
try:
from twisted.conch.checkers import SSHPublicKeyDatabase
class SSHKeyCheckerFactory(object):
"""
Generates checkers that will authenticate a SSH public key
"""
implements(ICheckerFactory, plugin.IPlugin)
authType = 'sshkey'
authHelp = sshKeyCheckerFactoryHelp
argStringFormat = 'No argstring required.'
credentialInterfaces = SSHPublicKeyDatabase.credentialInterfaces
def generateChecker(self, argstring=''):
"""
This checker factory ignores the argument string. Everything
needed to authenticate users is pulled out of the public keys
listed in user .ssh/ directories.
"""
return SSHPublicKeyDatabase()
theSSHKeyCheckerFactory = SSHKeyCheckerFactory()
except ImportError:
# if checkers can't be imported, then there should be no SSH cred plugin
pass