Ubuntu零碎问题记录

设置允许root用户远程连接

检查是否安装包

root@ubuntu1804:~# dpkg -l openssh-server

安装

apt install openssh-server -y

配置文件

root@ubuntu1804:~# vim /etc/ssh/sshd_config
#PermitRootLogin prohibit-password
PermitRootLogin yes

重启服务

systemctl restart sshd

普通用户设置root密码

kktb@kktb:~$ sudo passwd
Enter new UNIX password:  # root用户的密码
Retype new UNIX password: 
passwd: password updated successfully
kktb@kktb:~$ su root
Password: 
root@kktb:/home/kktb# cd
root@kktb:~# id
uid=0(root) gid=0(root) groups=0(root)

root设置密码

root用户默认没有口令

检查root用户有无密码

getent passwd root

给root用户设置密码

passwd root 

忘记root口令重置

开机按shift键进入grub启动菜单;
e进入编辑启动菜单选项;
linux开头行后删除ro 写入 rw init=/bin/bash
F10重启进入xx模式;
查看根目录是否可写mount | grep -w / 显示有rw字样;
重置root密码passwd root,输入两次密码确认;
重启exec /sbin/init
执行passwd报错时,查看根目录是否挂载为可写模式,如果不是,重新挂载mount -o remount,rw /

配置静态IP地址

[root@cause-virtual-machine ~]#vim /etc/netplan/01-network-manager-all.yaml

# Let NetworkManager manage all devices on this system
network:
  version: 2
  renderer: NetworkManager
  ethernets:
    ens32:
      addresses: [10.0.0.92/24]
      gateway4: 10.0.0.2
      nameservers:
        addresses: [223.5.5.5,114.114.114.114]

memcached开发库安装

root@web1:~#apt list "*memcached*"
Listing... Done
freeradius-memcached/bionic-updates,bionic-security 3.0.16+dfsg-1ubuntu3.1 amd64
kamailio-memcached-modules/bionic 5.1.2-1ubuntu2 amd64
libanyevent-memcached-perl/bionic,bionic 0.08-1 all
libapache-session-memcached-perl/bionic,bionic 0.03-1 all
libcache-memcached-fast-perl/bionic 0.25-1 amd64
libcache-memcached-getparserxs-perl/bionic 0.01-1build4 amd64
libcache-memcached-libmemcached-perl/bionic,bionic 0.04001-1 all
libcache-memcached-managed-perl/bionic,bionic 0.24-1 all
libcache-memcached-perl/bionic,bionic 1.30-1 all
libcgi-session-driver-memcached-perl/bionic,bionic 0.04-1 all
libchi-driver-memcached-perl/bionic,bionic 0.15-1 all
libdancer-session-memcached-perl/bionic,bionic 0.2020-2 all
libmemcached-dbg/bionic-updates 1.0.18-4.2ubuntu0.18.04.1 amd64
libmemcached-dev/bionic-updates 1.0.18-4.2ubuntu0.18.04.1 amd64
libmemcached-libmemcached-perl/bionic 1.001801+dfsg-2build2 amd64
libmemcached-tools/bionic-updates 1.0.18-4.2ubuntu0.18.04.1 amd64
libmemcached11/bionic-updates 1.0.18-4.2ubuntu0.18.04.1 amd64
libmemcachedutil2/bionic-updates 1.0.18-4.2ubuntu0.18.04.1 amd64
libmemoize-memcached-perl/bionic,bionic 0.03-2 all
lua-nginx-memcached/bionic,bionic 0.10-1 all
memcached/bionic-updates,bionic-security,now 1.5.6-0ubuntu1.2 amd64 [installed]
memcachedb/bionic 1.2.0-12build1 amd64
opensips-memcached-module/bionic 2.2.2-3build4 amd64
php-memcached/bionic 3.0.1+2.2.0-1build2 amd64
puppet-module-saz-memcached/bionic,bionic 3.1.0-1 all
z-push-ipc-memcached/bionic,bionic 2.3.8-2ubuntu1 all

安装

root@web1:~#apt -y install  libmemcached-tools

测试命令-查看memcached当前状态

root@web1:~#memcstat --servers=10.0.0.85
Server: 10.0.0.85 (11211)
	 pid: 6129
	 uptime: 2075
	 time: 1656932762
	 version: 1.5.6
	 libevent: 2.1.8-stable
	 pointer_size: 64
	 rusage_user: 0.118869
	 rusage_system: 0.086946
	 max_connections: 1024
	 curr_connections: 2
	 total_connections: 66
	 rejected_connections: 0
	 connection_structures: 4
	 reserved_fds: 20
	 cmd_get: 0
	 cmd_set: 0
.......

ubuntu23配置networkmanager

最小化安装的ubuntu23的网络管理默认不是networkmanager,不能使用nmcli命令,另外从20还是哪一个版本开始,网关的配置不使用gateway4了,使用routes关键字配置网关

安装networkmanager包

apt install network-manager -y
[root@master02 ~]#cat /etc/netplan/00-installer-config.yaml 
# This is the network config written by 'subiquity'
network:
  renderer: NetworkManager # 指定使用networkmanager接管网络配置
  ethernets:
    ens32:
      dhcp4: false
      addresses:
        - 10.0.6.6/16
      routes:
        - to: default
          via: 10.0.0.3
      nameservers:
        addresses: [10.0.0.3]
  version: 2
netplan apply
[root@master02 ~]#nmcli con 
NAME           UUID                                  TYPE      DEVICE    
netplan-ens32  7fa2bb2b-abd5-39d1-a648-0c15abce21ef  ethernet  ens32     
cni0           4b20f979-4d80-4314-ae2a-db954a2ded47  bridge    cni0      
flannel.1      427d3c15-5e0d-42e4-84af-28fa231a965c  vxlan     flannel.1 
docker0        5c8c7455-ae9c-4455-a1f2-90ef8d6e436a  bridge    docker0   

如果仅仅安装了network-manager包,不在网卡配置文件中配置的话 nmcli con命令行看到的内容是空的

ubuntu安装命令

安装MySQL客户端 redis客户端

apt install redis-tools mysql-client -y

文件系统

ext4文件系统不支持在线扩容inode节点,xfs支持在线扩容inode节点,一般情况下是创建文件系统时分配inode节点

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值