Linux
1.创建账户,设置用户名密码
Useradd user0 -p 12345678
cat /etc/shadow
2.分配管理员权限
Usermod -G wheel user0
Id user0
3.删除其他管理员账户
getent group wheel
userdel -r user1
Id user1
4.验证能否登录(或登录管理后台)
Su user0
sudo whoami
数据库
0.安装数据库
vim /etc/sysconfig/network-scripts/ifcfg-ens33
Onboot=yes
Tar -xvf 解压数据库安装包
mv mysql-5.7.38-linux-glibc2.12-x86_64 mysql
Groupadd mysql
Useradd -r -g mysql mysql
cd至根目录
Mkdir -p /usr/local/mysql/data
Chown -R mysql:mysql /usr/local/mysql
Chmod -R 755 /usr/local/mysql/data
/usr/local/mysql/bin/mysqld --initialize --user=mysql --datadir=/usr/local/mysql/data --basedir=/usr/local/mysql
alter user ‘root’@‘localhost’ identified by ‘123456’;
1.创建账户,设置用户名密码
Mysqladmin -u root -p 旧密码 password “新密码”
Mysql -u root -p
Show databases;
Select user,host,password from mysql.user;
GRANT ALL PRIVILEGES ON . TO ‘用户名’@’localhost’
IDENTIFIED BY ‘密码’ WITH GRANT OPTION;
FLUSH PRIVILEGES;(刷新权限)
2.分配管理员权限
3.删除其他管理员账户
Delete from user where user=’haha’
4.验证能否登录(或登录管理后台)
交换机
1.正确开启交换机 SSH 模式
Sys(进入系统视图)
public-key local create rsa
public-key local create dsa
ssh server enable
user-interface vty 0 4
authentication-mode scheme
protocol inbound ssh
Quit
save
2.正确新建用户bbssh,并指定其用ssh登录
local-user user1 class manage
Password simple abcd123456
service-type ssh
authorization-attribute user-role network-admin
Quit
Ssh user user1 service-type stelnet authentication-type password
Save
3.正确关闭FTP服务
Undo ftp server enable
4.正确关闭 Telnet 服务
user-interface vty 0 4
authentication-mode scheme
protocol inbound ssh
Quit
save
5.拓展:交换机的账户管理
Display local-user
Local-user user0
Password simple abc123456
Undo local-user user0 class manage