-
安装 Multipass on Windows
Download Multipass for Windows
Note: 需要 Windows 10 Pro/Enterprise/Education v 1803 or later, or any Windows 10 with VirtualBox
确保您的网络是私有的,否则 Windows 会阻止 Multipass 启动.
运行安装程序。 您需要允许安装程序获得管理员权限.
-
How to launch LTS instances
Multipass 的前五分钟让您知道拥有轻量级云是多么容易。 让我们启动几个 LTS 实例,列出它们,执行命令,使用 cloud-init 并清理旧实例以启动。
启动一个 instance (by default you get the current Ubuntu LTS)
multipass launch --name foo
Run commands in that instance, try running bash (logout or ctrl-d to quit)
multipass exec foo -- lsb_release -a
在启动时将 cloud-init 元数据文件传递给实例。 详情请参阅使用 cloud-init with multipass
multipass launch -n bar --cloud-init cloud-config.yaml
See your instances
multipass list
Stop and start instances
multipass stop foo bar
multipass start foo
Clean up what you don’t need
multipass delete bar
multipass purge
Find alternate images to launch with multipass
multipass find
Get help
multipass help
multipass help <command>
现在不要忘记你还在运行 'foo'
。 要了解有关 Multipass 的更多信息,请继续阅读,转到文档,或 [加入讨论并参与其中。](https://discourse.ubuntu.com/c/multipass /21)
-
配置xshell连接此实例
一、点击Xshell菜单栏的工具,选择新建用户密钥生成向导,进行密钥对生成操作。
二、修改sshd的配置文件,启用密钥认证登录,同时关闭密码认证,并重启服务
[root@linux-node ~]# grep ‘^[A,P]’ /etc/ssh/sshd_config
PubkeyAuthentication yes #启用PublicKey认证
AuthorizedKeysFile .ssh/authorized_keys #PublicKey文件路径
PasswordAuthentication no #不适用密码认证登录
[root@linux-node ~]# systemctl restart sshd
三、进入home/用户名目录下的.ssh目录下,将生成的公钥拷贝到authorized_keys文件中,并赋予600权限
1、公钥的位置
2、将公钥拷贝到authorized_keys文件
备注:如果home目录下面没有.ssh目录,可以通过ssh-keygen命令
四、登录
备注:
#如果想禁止密钥登录应修改sshd的配置文件 /etc/ssh/sshd_config,将yes改为no,默认为yes
RSAAuthentication no
PubkeyAuthentication no