From 4eec31e42df2853f0a1db72d998a2ce9c5979818 Mon Sep 17 00:00:00 2001 From: ibuler Date: Fri, 26 Dec 2014 00:11:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=98=BE=E7=A4=BA1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- connect.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/connect.py b/connect.py index 78fd16992..488264d82 100755 --- a/connect.py +++ b/connect.py @@ -15,13 +15,10 @@ import getpass from django.core.exceptions import ObjectDoesNotExist from Crypto.Cipher import AES from binascii import b2a_hex, a2b_hex -import re - os.environ['DJANGO_SETTINGS_MODULE'] = 'jumpserver.settings' django.setup() - -from juser.models import User, Group -from jasset.models import Asset, IDC +from juser.models import User +from jasset.models import Asset from jpermission.models import Permission try: @@ -109,6 +106,7 @@ def posix_shell(chan, user, host): if not os.path.isdir(today_connect_log_dir): try: os.makedirs(today_connect_log_dir) + os.chmod(today_connect_log_dir, 0777) except OSError: alert_print('Create %s failed, Please modify %s permission.' % (today_connect_log_dir, connect_log_dir)) @@ -258,7 +256,6 @@ def connect(username, password, host, port): # Set PS1 and msg it channel.send(ps1) channel.send(login_msg) - print channel.get_name() # Make ssh interactive tunnel posix_shell(channel, username, host)