โŒ

Normal view

There are new articles available, click to refresh the page.
Before yesterdayMain stream

How to login to Linux created using Azure with username and password

What I want to do:

  • I want to make an SSH connection and log in to Linux, which was created using Azure, as a user named testuser.

Problem:

  • I get the following error when I run the ssh command.
C:\Users\avduser>ssh testuser@<IP address>
testuser@<IP address>: Permission denied(publickey).
  • /var/log/auth.log
Connection reset by authenticating user testuser <IP address> port <portNum> [preauth]

**I tried: **

  • change /etc/ssh/sshd_config
PasswordAuthentication yes
  • service restart: systemctl restart sshd
  • virtial Machine restart: reboot

I don't have any other ideas to try. Thank you

Uploading a file to azure storage account as a blob with authentication using managed identities

I want to upload a text file from a VM to storage account. For this I have created a VM with system assigned managed identity enabled. I assigned the managed identity to Storage account as RBAC policy (given the Storage Blob Data Owner permissions). I now want to upload the file in a container name log using curl request (since I don't have az cli installed in the VM). How can I do that.

The file that I want to upload is test.txt and want to upload with same name.

Thanks

Getting Failed to restart tlu.service: Interactive authentication required while executing a remote command in gcp vm

I am trying to restart a service on a linux vm non interactively using following command.

gcloud compute ssh {user}@{vm_name} --command="{script}" --project={tenant_project_name} --zone={vm_zone} --tunnel-through-iap --quiet
 script = systemctl restart tlu

I have seen many articles and came to conclusion to run sudo su initially and run the retart command. But when i ran sudo su the pipeline agent ran for a long time (till now). However if I try inside the vm, after executing sudo su password is not prompted.

Please help me here

Cannot Connect to Google Cloud Storage from Google Compute Engine Virtual Machine

I have looked at posts with similar issues, telling me to update API permissions, which I have: Enabled Storage API

I have also granted permission to the service agent in my Google Cloud storage bucket: enter image description here

I have tried starting/restarting the instance multiple times with the changed settings and it is never working. It keeps giving me access denied: enter image description here

The GCS and the GCE VM are both under the same project, and I am able to copy from it just fine. enter image description here

Does anyone have another fix for this? I am still new to Google Cloud so further instructions/clarifications would also be helpful!

Why does wsl --install always yield Catastrophic Failure on my new Windows 11 Home 22H2 installation?

I am trying to start using Ubuntu 22.04 inside my Windows 11 laptop using wsl. I have gotten this to work on my desktop. However, every time I try to run 'wsl --install' (or 'wsl --install -d Ubuntu-22.04'), it ends with 'Catastrophic failure'.

My laptop is a new Lenovo LOQ.

I'll happily provide any more system details that would be useful.

Thanks in advance.

I have tried running 'wsl --install' (or 'wsl --install -d Ubuntu-22.04') using powershell, command prompt, with and without 'run as administrator', as well as 'netsh winsock reset' & reboot.

I have also checked that VM is enabled in the BIOS.

I was expecting these to work, since online users found that they worked for them (from microsoft's support pages as well as reddit), but 'Catastrophic failure' was the result each time.

VM Policy Assignment: NoComplianceReport

I currently have a VM with AzureMonitorWindowsAgent and AzurePolicyforWindows extensions installed.

I receive the following error message after assigning a custom policy definition derived from a DSC to the VM: VM Policy Page

Compliance Details:
Reason for non-compliance
No related resources match the effect details in the policy definition. (Error code: NoComplianceReport)

Existence condition
Type
Microsoft.GuestConfiguration/guestConfigurationAssignments
Name
[concat('DSCPackageArtifact$pid', uniqueString(policy().assignmentId, policy().definitionReferenceId))]


Possible solutions for this problem would be appreciated.

I previously left it for roughly 45 minutes and the error message changed to another error. However, It has not done this again.

Issue using Swiftโ€™s URLSession Library on Ubuntu to fetch data from an API

When attempting to call an API from Swift using the following code I get an unknown error at runtime as shown below. Using Wireshark I was able to confirm that the request is being properly sent to API and that the API is responding correctly with the expected data, however I have been unable to receive that data properly from within Swift.

import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

/// Defines the possible errors
public enum URLSessionAsyncErrors: Error {
    case invalidUrlResponse, missingResponseData
}

public extension URLSession {
     func asyncData(from url: URL) async throws -> (Data, URLResponse) {
        return try await withCheckedThrowingContinuation { continuation in
            let task = self.dataTask(with: url) { data, response, error in
                if let error = error {
                    continuation.resume(throwing: error)
                    return
                }
                guard let response = response as? HTTPURLResponse else {
                    continuation.resume(throwing: URLSessionAsyncErrors.invalidUrlResponse)
                    return
                }
                guard let data = data else {
                    continuation.resume(throwing: URLSessionAsyncErrors.missingResponseData)
                    return
                }
                continuation.resume(returning: (data, response))
            }
            task.resume()
        }
    }
}

let urlLink = URL(string: "https://trial.serviceobjects.com/AV3/api.svc/GetBestMatchesJson?BusinessName=&Address=27%20E%20Cota%20St&Address2=Suite%20500&City=Santa%20Barbara&State=CA&PostalCode=93101&LicenseKey=ws72-soa1-dev1")
let (data, response) = try await URLSession.shared.asyncData(from: urlLink!)

print(response)
print(data)

The result of running the code is the following error message:

Swift/ErrorType.swift:200: Fatal error: Error raised at top level: Error Domain=NSURLErrorDomain Code=-1 "(null)" 
Current stack trace:
0    libswiftCore.so                    0x00007f1f4966eb80 _swift_stdlib_reportFatalErrorInFile + 112
1    libswiftCore.so                    0x00007f1f4936043f <unavailable> + 1442879
2    libswiftCore.so                    0x00007f1f49360257 <unavailable> + 1442391
3    libswiftCore.so                    0x00007f1f4935f060 _assertionFailure(_:_:file:line:flags:) + 364
4    libswiftCore.so                    0x00007f1f493bdec6 <unavailable> + 1826502
5    swift                              0x000055c44836ce2b <unavailable> + 20011
6    libswift_Concurrency.so            0x00007f1f498b10ce <unavailable> + 274638
7    libswift_Concurrency.so            0x00007f1f498b1840 swift_job_run + 92
8    libdispatch.so                     0x00007f1f499cdf45 <unavailable> + 192325
9    libdispatch.so                     0x00007f1f499cebbd <unavailable> + 195517
10   libdispatch.so                     0x00007f1f499d6002 <unavailable> + 225282
11   libc.so.6                          0x00007f1f48e94b43 <unavailable> + 609091
12   libc.so.6                          0x00007f1f48f26a00 <unavailable> + 1206784
Illegal instruction (core dumped)

I have tried the standard dataTask function multiple times and still receive the same -1 error code so I am certain the issue is not the modifications for the URLSession I included above.

According to Apple's documentation the -1 error is an unknown error which has made this extremely difficult to debug.

To give greater context, I am using Swift version 5.8.1 on an Ubuntu version 22.04.3 virtual machine hosted on virtual box version 7.0.10 on a windows 11 pc.

Has anyone else experienced this issue or know to fix it?

How to set docker Proxy to the host computer from the VMware guset computer for using host's 7890 port?

I have a Windows host compouter, and using VWware created a linux virtual computer, which installed docker to create containers and support service.

Recently, I found a image hardly to competel downloading, always pause at 4.xxxMB at total while the full image has 50MB.

So I decide to set Proxy with my host computer's Clash 7890 port, here the config at /etc/systemd/system/service.docker.d/proxy.conf

[Service]
Environment="HTTP_PROXY=http://192.168.224.1:7890/"
Environment="HTTPS_PROXY=http://192.168.224.1:7890/"
Environment="NO_PROXY=localhost,127.0.0.1"

The 192.168.224.1 is my VMware Network Adaptor VMnet8 address in host Windows computer and the Gateway is 192.168.224.2 , and for guest vm, address is 192.168.224.112

In my guest vm, I try address [192.168.224.1, 192.168.224.2, 172.180.6.43], but all failed, the message such as:

Error response from daemon: Get "https://registry-1.docker.io/v2/": proxyconnect tcp: dial tcp 172.180.6.43:7890: connect: connection refused

(Addition: This address is my host computer ip using WiFi, and it's dynamic for different using place)

So I try again using my host computer, but still, except 127.0.0.1, others doesn't work.

PS C:\Users\Admin> (80,334,7890) | % {echo ((new-object Net.Sockets.TcpClient).Connect("172.180.6.43",$_)) "Port $_ is open!"} 2>$null
PS C:\Users\Admin> (80,334,7890) | % {echo ((new-object Net.Sockets.TcpClient).Connect("192.168.224.1",$_)) "Port $_ is open!"} 2>$null
PS C:\Users\Admin> (80,334,7890) | % {echo ((new-object Net.Sockets.TcpClient).Connect("192.168.224.2",$_)) "Port $_ is open!"} 2>$null
PS C:\Users\Admin> (80,334,7890) | % {echo ((new-object Net.Sockets.TcpClient).Connect("127.0.0.1",$_)) "Port $_ is open!"} 2>$null
Port 7890 is open!

How could I set the vm docker proxy to host 127.0.0.1:7890?

Use of undeclared identifier 'VZMacKeyboardConfiguration'

I am attempting to follow the guide, Running macOS in a virtual machine on Apple silicon.

I downloaded the file RunningMacOSInAVirtualMachineOnAppleSilicon.zip, extracted it, and opened the project in Xcode. I used my personal Apple developer profile for signing.

Now, I'm seeing an error.

MacOSVirtualMachineConfigurationHelper.m:84:18 
Use of undeclared identifier 'VZMacKeyboardConfiguration'

This is the code it's trying to build:

+ (VZKeyboardConfiguration *)createKeyboardConfiguration
{
    if (@available(macOS 14.0, *)) {
        return [[VZMacKeyboardConfiguration alloc] init];
    } else {
        return [[VZUSBKeyboardConfiguration alloc] init];
    }
}

Update: I'm actually running macOS 13 and Xcode 14, and after re-reviewing the docs, it seems that this requires macOS 14 and Xcode 15.

Is there a way to build on macOS 13 with Xcode 14?

โŒ
โŒ