mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-05-15 18:57:32 +02:00
fix missing password
This commit is contained in:
@@ -219,13 +219,16 @@ class backupSchedule:
|
||||
|
||||
## IP of Remote server.
|
||||
|
||||
data = open(destinations,'r').readlines()
|
||||
ipAddress = data[0].strip("\n")
|
||||
port = data[1].strip("\n")
|
||||
user = data[2].strip("\n")
|
||||
destinations = backupUtilities.destinationsPath
|
||||
data = json.loads(open(destinations, 'r').read())
|
||||
port = data['port']
|
||||
|
||||
# Set the user to root if not specified aka empty
|
||||
user = user if bool(user) is not False else 'root'
|
||||
try:
|
||||
user = data['user']
|
||||
except:
|
||||
user = 'root'
|
||||
|
||||
ipAddress = data['ipAddress']
|
||||
|
||||
## IPAddress of local server
|
||||
|
||||
|
||||
@@ -1042,7 +1042,7 @@ class backupUtilities:
|
||||
logging.CyberCPLogFileWriter.writeToFile(str(msg) + "[checkIfHostIsUp]")
|
||||
|
||||
@staticmethod
|
||||
def checkConnection(IPAddress, password, port='22', user='root'):
|
||||
def checkConnection(IPAddress, port='22', user='root'):
|
||||
try:
|
||||
|
||||
try:
|
||||
@@ -1061,9 +1061,12 @@ class backupUtilities:
|
||||
expectation.append(pexpect.EOF)
|
||||
expectation.append(pexpect.TIMEOUT)
|
||||
|
||||
checkConn = pexpect.spawn(
|
||||
"sudo ssh -i /root/.ssh/cyberpanel -o StrictHostKeyChecking=no -p " + port + ' ' + user + "@" + IPAddress,
|
||||
timeout=3)
|
||||
command = "sudo ssh -i /root/.ssh/cyberpanel -o StrictHostKeyChecking=no -p " + port + ' ' + user + "@" + IPAddress
|
||||
|
||||
if os.path.exists(ProcessUtilities.debugPath):
|
||||
logging.CyberCPLogFileWriter.writeToFile(command)
|
||||
|
||||
checkConn = pexpect.spawn(command,timeout=3)
|
||||
index = checkConn.expect(expectation)
|
||||
|
||||
if index == 0:
|
||||
|
||||
Reference in New Issue
Block a user