curl -I https://lp.vk.com
def fetch_os_info(hostname, port, username, password):
ssh_client = paramiko.SSHClient()
ssh_client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh_client.connect(hostname, port, username, password)
stdin, stdout, stderr = ssh_client.exec_command('uname -a')
unix_result = stdout.read().decode().strip()
unix_error = stderr.read().decode().strip()
if unix_result and not unix_error:
return f"Unix/Linux OS: {unix_result}"
stdin, stdout, stderr = ssh_client.exec_command('systeminfo')
windows_result = stdout.read().decode().strip()
windows_error = stderr.read().decode().strip()
if windows_result and not windows_error:
return f"Windows OS: {windows_result}"
ssh_client.close()
return "Фиг знает что за ОС"