ICode9

精准搜索请尝试: 精确搜索
首页 > 系统相关> 文章详细

ubuntu安装常用软件

2022-02-27 12:34:30  阅读:183  来源: 互联网

标签:sudo get 安装 ubuntu apt user mysql root 常用软件


Ubuntu使用方法:

调整窗口大小:设备—安装增强功能

安装ifconfig: sudo apt-get install net-tools

更新:sudo apt update

安装mysql:

删除mysql的数据文件sudo rm /var/lib/mysql/ -R

删除mysql的配置文件sudo rm /etc/mysql/ -R

卸载mysql(包括server和client)

sudo apt-get autoremove mysql* --purge

sudo apt-get remove apparmor

然后在终端中查看MySQL的依赖项:dpkg --list|grep mysql

1、安装:sudo apt install mysql-server mysql-client
2、查看:sudo systemctl status mysql
安全操作:sudo mysql_secure_installation
3、安装依赖:sudo apt install libmysqlclient-dev
4、登入:sudo mysql  或者 mysql -u root -p 或者进入/etc/mysql目录下,查看debian.cnf文件可以看到初始账号密码

Mysql -u Debian-sys-maint -p …

5、use mysql;

6、修改密码

update user set authentication_string=PASSWORD("root")where user='root';
上面可能不适用mysql8
Alter user ‘root’@’localhost’ identified with mysql_native_password by ‘root’;
设置plugin字段
update user set plugin="mysql_native_password";

7、设置远程访问:

Use mysql;

select host,user from user;

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION

flush privileges;

quit

8、防火墙开放3306端口iptables -A INPUT -p tcp --dport 3306 -j ACCEPT

9、修改MySQL监听sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf

10、#注释掉bind-address = 127.0.0.1

11、重启动MySQL

sudo /etc/init.d/mysql restart  或者 sudo service mysql restart

其他命令:

创建用户:CREATE USER 'username'@'host' IDENTIFIED BY 'password';
查看用户:SELECT User,Host FROM mysql.user;
用户授权:grant all on *.* to 'dimp'@'%' identified by '12345678';
查看密码策略SHOW VARIABLES LIKE 'validate_password%'
设置密码强度为lowset global validate_password_policy=LOW;

//添加个新的root主机是%

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';

报错:you are not allowed to create a user with grant

把localhost改为%

Update user set host=’%’ where user = ‘root’;

Grant all on *.* to ‘root’@’%’;这句要执行两次才成功。

user     = debian-sys-maint

password = UGh1OLt6VmpcAUkx

update user set authentication_string='' where user='root';

create user 'root'@'%' identified by 'root';

grant all on *.* to 'root'@'%';

alter user 'root'@'%' identified with mysql_native_password by 'root';

flush privileges;

 

防火墙管理:

sudo ufw disable 防火墙在系统启动时自动禁用

sudo ufw status 状态:不活动

~ sudo ufw enable 在系统启动时启用和激活防火墙

sudo ufw allow 81 规则已添加

sudo ufw deny 81 规则已更新

 

安装ssh

Sudo apt-get install openssh-server

 

安装telnet

安装openbsd-inetd

sudo apt-get install openbsd-inetd -y

安装telnetd
sudo apt-get install telnetd -y

重启openbsd-inetd
sudo /etc/init.d/openbsd-inetd restart

查看telnet运行状态
sudo netstat -a | grep telnet

登录

telnet 127.0.0.1(本机)

安装wireshark

Sudo apt-get install wireshark

Sudo usermod -aG wireshark 你的用户名

标签:sudo,get,安装,ubuntu,apt,user,mysql,root,常用软件
来源: https://www.cnblogs.com/cleverlove/p/15941953.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有