0、IP地址查看

ubuntu查看本机IP地址,先安装net-tools。并且记录你的ip地址xxx.xxx.xxx.xxx

sudo apt install net-tools
ifconfig

在win+r打开输入cmd,如果在同一个局域网应该是可以ping通的

ping xxx.xxx.xxx.xxx

1、ssh连接和sftp连接

ubuntu 安装ssh 服务

sudo apt-get install ssh
service ssh start

win中可以打开mobax,通过ip进行访问了

2、固定自己的IP

通常情况下动态分配ip,每次重启后ip都会变化,因此采用设置固定ip。首先通过

ifconfig和route -n获得自己的ip和网关

cd /etc/netplan/
ls
sudo chmod 777 01-network-manager-all.yaml
vim 01-network-manager-all.yaml
network:
  version: 2
  renderer: NetworkManager
  ethernets:
    ens33:   #配置的网卡名称
      dhcp4: no    #dhcp4关闭
      dhcp6: no    #dhcp6关闭
      addresses: [你自己的ip/24]   #设置本机IP及掩码
      gateway4: 你自己的网关   #设置网关
      nameservers:
        addresses: [114.114.114.114, 8.8.8.8]   #设置DNS
sudo netplan apply

发现一个问题:如果需要校园认证的网络,如果固定了就没法连接服务器了。

3、win10远程桌面,有的时候希望有图形化页面

sudo apt-get install xorg
sudo apt-get install xserver-xorg-core
sudo apt-get install xorgxrdp

sudo apt install xfce4 xfce4-goodies xorg dbus-x11 x11-xserver-utils

sudo apt install xrdp
sudo systemctl status xrdp
sudo systemctl restart xrdp
sudo sed -i.bak '/fi/a #xrdp multiple users configuration \n xfce-session \n' /etc/xrdp/startwm.sh
echo xfce4-session > ~/.xsession
sudo systemctl restart xrdp

打开win10 的远程桌面输入ip和用户名,连接后输入密码就可以看到图形化页面

参考:

https://www.jianshu.com/p/8848cd68d45b

https://blog.csdn.net/qq_19734597/article/details/104087091

https://blog.csdn.net/LisaCpolar/article/details/126751019

Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐