这个/etc/netplan下默认有个文件50-cloud-init.yaml,直接修改它就行了

sudo vim /etc/netplan/50-cloud-init.yaml

网口名字enp0s3可以通过ip a查到。 这个文件默认已经有网口名字了,将dhcp关闭,填上ip、网关、DNS地址:

network:
    ethernets:
        enp0s3:
            dhcp4: false
            addresses:[192.168.0.201/24]
            gateway4: 192.168.0.1
            nameservers:
                addresses: [192.168.0.1, 8.8.8.8]
    version: 2

保存后,执行 sudo netplan --debug apply 应用更新。
静态IP即可。

虚拟机安装的Ubuntu Server镜像,向导里需要设置用户账号,没有设置root密码.

1.登陆初始账号,修改root 密码
sudo passwd root

su切换root 试试

2.root 账号下修改配置文件
vi /etc/ssh/sshd_config
找到下面相关配置:

# Authentication:
LoginGraceTime 120
PermitRootLogin prohibit-password
StrictModes yes

更改为:

# Authentication:
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes

3.重启ssh
sudo service ssh restart

Use find to list the current folder:

find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'

Add to ~/.bash_profile or ~/.zshrc
alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'"
  

Or install the tree with brew
brew install tree

I installed the ansible via pip install, and there are several issues here:

where is the config

Here you should create a file ~/.ansible.cfg

[defaults]
inventory =~/.ansible/hosts
sudo_user=root
remote_port=22
host_key_checking=False
remote_user=root
log_path=~/.ansible/log/ansible.log
module_name=command
private_key_file=~/.ssh/id_rsa

- 阅读剩余部分 -