Skip to content

Commit

Permalink
解决用户名显示不全的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
eecoder-dyf committed Apr 17, 2024
1 parent 2d11da4 commit 6bbdc00
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions machine/IRCmachinedocker/code/get_user_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ def task1(ip,user,passwd,machine_name,port):
if temp_data[kk]!='|' and temp_data[kk]!='':
temp_user.append(temp_data[kk])
#获取用户名
p = os.popen('timeout 10s sshpass -p "{}" ssh {}@{} -p {} ps -f -p'.format(passwd,user,ip,port) + str(temp_user[-4]))
out = p.read().split('\n')[1].split(' ')[0]
p = os.popen('timeout 10s sshpass -p "{}" ssh {}@{} -p {} ps -o user= -p '.format(passwd,user,ip,port) + str(temp_user[-4]))
out = p.read().strip()

if temp_user[0] in all_data.keys():
if out in all_data[temp_user[0]].keys():
Expand Down

0 comments on commit 6bbdc00

Please sign in to comment.