我无法从Mac连接到Linux [英] I can not connect from Mac to Linux

查看:272
本文介绍了我无法从Mac连接到Linux的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我尝试了很多时间,但是无法连接到我的linux VM.我删除并重新构建了几次,但仍然没有.

我使用适用于Mac的Windows远程桌面.

我的错误消息是;

无法使用远程PC.请确认远程桌面已启用,远程PC已打开并且在网络上可用,然后重试.

解决方案

要远程连接到Linux虚拟机,您需要在Azure门户上为您的VM的网络安全设置中打开端口22(SSH).然后,您使用名为Putty的软件来创建用于对VM进行身份验证的连接密钥. 如果您希望通过RDP连接,则必须在最初通过SSH连接之后在Linux Vm上安装xRDP

您可以通过转到Azure门户自行添加此端口规则,

选择虚拟机"边栏选项卡(左侧门户"屏幕)

选择您的虚拟机,然后在打开的屏幕上选择网络

在网络连接中,点击添加入站端口规则.按钮

当新标签页打开时,您需要输入以下详细信息,

来源-任何

源端口范围保留为*

目的地-任何

目标端口范围- 22(如果是linux vm) 

优先级-可以保留原样,但数字越小,给定的优先级越高

名称-可以是您喜欢的名称,但通常是22,SSH

选择添加.

由于这是Linux Vm,因此您需要下载Putty并创建SSH密钥以初始连接到VM https://docs.microsoft.com/zh-cn/azure/virtual-machines/linux/ssh-from-windows#create-ssh-keys-with-puttygen

一旦在Linux Vm上,您将需要安装xRDP,我们具有在您的Linux废弃VM上进行设置的本指南. https://buildazure.com/2018/02/28/how-to-setup-an-ubuntu-linux-vm-in-azure-with-remote-desktop-rdp-access/

如果此答案有帮助,请单击标记为答案"或向上投票.要提供有关您的论坛体验的其他反馈,请单击 此处 解决方案

Hi,

To remote connect to a Linux virtual machine you will need to have port 22 (SSH) open in the network security settings for your vm on the Azure portal. You then use software called Putty to create a connection key which is used to authenticate to the VM. If you prefer to connect through RDP you will have to install xRDP on the Linux Vm after you've initially connected through SSH

You can add this port rule yourself by going to the Azure Portal,

Select the Virtual Machines blade (left hand side Portal screen)

Select your Virtual Machine and on the screen that open select Networking

Within Networking click on the Add Inbound Port Rule  button

When the new tab opens you will need to enter the follow details,

Source - any

Source port range leave as a *

Destination - any

Destination port ranges -  22(if linux vm) 

Priority - can be left as is, but the lower the number the higher the priority given

Name - Can be what you like but usually 22, SSH 

Select Add.

As this is a Linux Vm you will need to download Putty and create an SSH key to initially connect to the VM https://docs.microsoft.com/en-us/azure/virtual-machines/linux/ssh-from-windows#create-ssh-keys-with-puttygen

Once on the Linux Vm you will need to install xRDP, we have this guide on setting it up on your linux bashed VM  https://docs.microsoft.com/en-us/azure/virtual-machines/linux/use-remote-desktop#install-and-configure-a-remote-desktop-server

Now head back into the network security group on the azure portal and add an inbound rule for port 3389 (as above but port range is 3389 and port name is RDP or 3389)
Try to connect again with the windows rdp app. It should ask you to enter the credentials you created when setting up the VM.


One other thing to check would be that the required ports are allowed on your network you can do this by pasting http://portquiz.net:22/ into your browser url and it should return a successful result if the port is allowed, you can do the same for port 3389 http://portquiz.net:3389/


This here is also a pretty good guide on Linux/Ubuntu and RDP  https://buildazure.com/2018/02/28/how-to-setup-an-ubuntu-linux-vm-in-azure-with-remote-desktop-rdp-access/


And here is a blog on the same https://blogs.msdn.microsoft.com/maheshk/2016/06/30/how-to-rdp-into-azure-linux-machine-using-xrdp/

If this answer was helpful, click "Mark as Answer" or Up-Vote. To provide additional feedback on your forum experience, click Here


这篇关于我无法从Mac连接到Linux的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆