| Server IP : 156.238.232.47 / Your IP : 216.73.216.150 Web Server : nginx/1.25.3 System : Linux C202504152095410 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : www ( 1000) PHP Version : 8.3.25 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /lib/python2.7/site-packages/cloudinit/config/ |
Upload File : |
�
oB�]c @ sT d Z d d l m Z d d l m Z d d l Z d d g Z d � Z d � Z d S( s9
SSH Import Id
-------------
**Summary:** import ssh id
This module imports ssh keys from either a public keyserver, usually launchpad
or github using ``ssh-import-id``. Keys are referenced by the username they are
associated with on the keyserver. The keyserver can be specified by prepending
either ``lp:`` for launchpad or ``gh:`` for github to the username.
**Internal name:** ``cc_ssh_import_id``
**Module frequency:** per instance
**Supported distros:** ubuntu, debian
**Config keys**::
ssh_import_id:
- user
- gh:user
- lp:user
i����( t ug_util( t utilNt ubuntut debianc C s� t | � d k rU | d } g } t | � d k rA | d } n t | | | � d St j | | j � \ } } g } x/| j � D]!\ } }
g } |
d r� t j | d g � } n5 y |
d } Wn$ t k
r� | j d | � q� n Xy2 t j
| � } g | D] } t | � ^ q} Wn$ t k
rD| j d | � q� n Xt | � sWq� n y t | | | � Wq� t k
r�}
t j | d | | � | j
|
� q� Xq� Wt | � r�| d � n d S( Ni i t defaultt
ssh_import_ids+ User %s is not configured for ssh_import_ids5 User %s is not correctly configured for ssh_import_ids ssh-import-id failed for: %s %s( t lent import_ssh_idsR t normalize_users_groupst distrot itemsR t get_cfg_option_listt Exceptiont debugt
uniq_merget strt logexct append( t _namet cfgt cloudt logt argst usert idst userst _groupst elistt user_cfgt
import_idst it exc( ( sE /usr/lib/python2.7/site-packages/cloudinit/config/cc_ssh_import_id.pyt handle) sF
#
c C s� | o | s# | j d | | � d Sy t j | � Wn t k
rO } | � n Xd d | d g | } | j d | � y t j | d t �Wn/ t j k
r� } t j | d | � | � n Xd S( Ns( empty user(%s) or ids(%s). not importingt sudos -Hus
ssh-import-ids Importing ssh ids for user %s.t captures* Failed to run command to import %s ssh ids( R
t pwdt getpwnamt KeyErrorR t subpt Falset ProcessExecutionErrorR ( R R R R t cmd( ( sE /usr/lib/python2.7/site-packages/cloudinit/config/cc_ssh_import_id.pyR Y s
( t __doc__t cloudinit.distrosR t cloudinitR R# t distrosR R ( ( ( sE /usr/lib/python2.7/site-packages/cloudinit/config/cc_ssh_import_id.pyt <module> s 0