使用ubuntu远程连接windows, Connect to a Windows PC from Ubuntu via Remote Desktop Connection

from: https://www.digitalcitizen.life/connecting-windows-remote-desktop-ubuntu

NOTE: This tutorial was created on Ubuntu 13.04 (Raring Ringtail). it is suit to ubuntu 16.04(2018/03 buxizhizhoum).

Step 1: Enable Remote Desktop Connections on your Windows PC

In order to allow other computers to connect remotely to your Windows computer, you need to enable the Remote Desktop Connection feature. To learn how to do this, read this tutorial: How to Enable Remote Desktop Connections in Windows 7 & Windows 8.

Step 2: Install a Remote Desktop Client - Our Choice: Remmina Remote Desktop Client

By default, Ubuntu doesn’t come with a remote desktop client which supports the Remote Desktop Protocol (RDP) used by Windows operating systems for remote connections. You need to install one of the clients available in the Ubuntu Software Center.

First, start the Ubuntu Software Center.

Remmina, Remote Desktop Client, Ubuntu, Linux

Search for the words "remote desktop" and you will be shown all the available applications.

We preferred to choose Remmina Remote Desktop Client, a client which is very appreciated by the user community and is, at the same time, very versatile and easy to use.

To get it installed, select it and click Install.

Remmina, Remote Desktop Client, Ubuntu, Linux

You are asked for your password. Type it and click Authenticate.

Remmina, Remote Desktop Client, Ubuntu, LinuxNOTE: please keep in mind that, in order to install software, your user account needs to have administrative permissions. If you are set as a standard user account, you cannot install any software.

Now the application is downloaded and installed. Wait until the procedure ends.

Step 3: Configure the Remote Desktop Session

It is time to start the Remmina Remote Desktop Client. Search your Ubuntu PC using the word remmina and click on the appropriate search result.

Remmina, Remote Desktop Client, Ubuntu, Linux

Click the "Create a new remote desktop file" button.

Remmina, Remote Desktop Client, Ubuntu, Linux

The Remote Desktop Preference window is opened. Here you can configure the remote connection you want to establish.

In the Profile section, type the name you want to use for the connection. It can be anything you wish. Then, in the Basic tab, complete the IP address of the Windows computer in the Server field. Then, type the username and password you want to use to connect to the Windows computer. Be aware that the user needs to exist on the Windows computer. If you are using a Microsoft account on your Windows 8 PC, it is OK to fill in your email address and password.

You can also set the Resolution you want to use for the connection and the Color depth.

Remmina, Remote Desktop Client, Ubuntu, LinuxNOTE: Selecting a larger desktop resolution and color depth can impact the performance of your remote desktop session. If you experience lag when connected to a remote desktop, try reducing the color depth or resolution.

If you want to share a folder existing on your Ubuntu computer with the Windows computer, simply check the Share folder box and select the folder you want to share from Ubuntu.

Also, for more advanced settings, go to the Advanced tab. There you can turn the sound on or off, share printers, disable clipboard synchronisation, etc.

Remmina, Remote Desktop Client, Ubuntu, Linux

Once you are done making all the settings, click the Connect button. When connecting for the first time, a new certificate is created for the remote connection. Click OK to accept it.

Remmina, Remote Desktop Client, Ubuntu, Linux

After a while, if the Windows computer is turned on and connected to the same network, you should be connected to it.

Remmina, Remote Desktop Client, Ubuntu, Linux

Once you close the remote connection, Remmina Remote Desktop Client automatically saves it so that you will be able to reconnect at a later time, with a simple click on the connection name.

Remmina, Remote Desktop Client, Ubuntu, Linux

Conclusion

As you can see, the procedure is not really complicated. As long as you make the right settings and use a client which supports the RDP protocol, connecting remotely from Ubuntu to a Windows desktop is almost a trivial task. For other tutorials related remote desktop connectivity, check out the links below.

转载于:https://www.cnblogs.com/buxizhizhoum/p/8622671.html

### 如何通过 SSH 或远程桌面连接到主机 #### 使用 SSH 协议连接到主机 对于 macOS 用户来说,可以通过终端程序使用 SSH 安全地连接Ubuntu 主机。以下是具体方法: 1. **确保目标主机已启用 SSH 服务** 在 Ubuntu 上执行以下命令来安装并启动 SSH 服务: ```bash sudo apt-get update && sudo apt-get install openssh-server sudo systemctl start ssh ``` 可以验证 SSH 是否正常运行,通过 `ps -ef | grep ssh` 查看进程是否存在[^1]。 2. **获取目标主机 IP 地址** 确认 Ubuntu 的局域网 IP 地址,可以运行如下命令获得: ```bash ip addr show ``` 3. **在 Mac 终端中建立 SSH 连接** 打开 Mac 的 Terminal 应用,在其中输入以下命令进行连接: ```bash ssh username@ubuntu_host_ip_address ``` 将 `username` 替换为目标 Linux 主机上的用户名,将 `ubuntu_host_ip_address` 替换为实际的 IP 地址。 --- #### 使用远程桌面协议 (RDP/VNC) 连接到主机 如果需要更直观的操作体验,则可以选择 VNC 或 RDP 方式来进行图形化界面的远程控制。 1. **配置 VNC Server** 在 Ubuntu 中安装并设置好 VNC server 软件包之后,可通过 Remmina 工具完成连接过程。 - 安装 TigerVNC 或其他类似的工具: ```bash sudo apt-get install tightvncserver vncserver :1 ``` - 设置密码以及分辨率参数后停止当前会话以便后续调整优化: ```bash vncserver -kill :1 ``` 2. **利用 Remmina 实现客户端接入** 下载并开启 Remmina 图形界面应用程序,新建一条记录指定采用何种通信标准(此处推荐选用 VNC)。填写完毕基本信息如服务器地址等项目以后勾选启用 SSH Tunnel 功能项从而增强安全性保护措施[^2]。 3. **关于 Windows 平台下的 Remote Desktop Connection 方法简介** 对于基于 Microsoft 技术栈构建的服务而言,默认情况下仅限内部网络范围内的机器之间互相访问;外部互联网环境下则需额外配置防火墙策略或者 NAT 映射规则才能正常使用此特性[^3]。 ```python import paramiko def connect_via_ssh(host, port=22, user='root', password=None): client = paramiko.SSHClient() client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) try: client.connect(hostname=host, port=port, username=user, password=password) stdin, stdout, stderr = client.exec_command('ls') output = stdout.read().decode('utf-8').strip() return f'Command Output:\n{output}' except Exception as e: return str(e) finally: client.close() print(connect_via_ssh('example.com', user='testuser')) ``` ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值