ubuntu
辛勤汗水@
17年毕业于黑龙江大学,自学运维知识,走上运维的道路,目前在无人驾驶公司担任运维工程师,感谢大家的支持,与大家共同进步
展开
-
Ubuntu sudo:/usr/bin/sudo 必须属于用户 ID 0(的用户)并且设置 setuid 位
Ubuntu sudo:/usr/bin/sudo 必须属于用户 ID 0(的用户)并且设置 setuid 位昨天一个同事不小心把自己ubuntu16.04系统的根目录"/" 的权限给改了,执行了chmod 777 -R /命令导致自己的sudo命令执行报错“sudo:/usr/bin/sudo 必须属于用户 ID 0(的用户)并且设置 setuid 位”,然后子的root用户密码也忘记,然后帮忙一起看了一下。首先我们想到是把修改的权限改过来,但是现在没法执行sudo,也没法进入root用户,那我原创 2021-12-09 14:13:46 · 7864 阅读 · 0 评论 -
KVM常用命令
KVM常用命令承接之前写的文章:Centos7安装KVM本篇文章新增,非界面化,kvm管理的常用命令:virsh list --all #查看虚拟机状态virsh edit zp001 #编辑配置文件virsh autostart zp001 #设置物理机开机自动启动虚拟机virsh dumpxml zp001 > zp001.xml #导出虚拟机配置文件/etc/libvirt/qemu/原创 2021-07-27 11:28:15 · 694 阅读 · 0 评论 -
ubuntu16.04桌面版磁盘满了,导致系统进不去的解决办法(亲测)
ubuntu16.04桌面版磁盘满了,导致系统进不去的解决办法(亲测)进入救援模式1.开机启动后,等在出现grub菜单的时候,选中第一条ubuntu,按e键进行编辑2.找到linux开头的行,将光标移至到末尾,并添加 systemd.unit=rescue.target3.ctrl+x 进入救援模式,输入root密码4.查找大文件,进行删除后重启问题解决了!!!!!!!!!!!!!!!...原创 2021-07-21 22:07:52 · 1496 阅读 · 0 评论 -
supervisor进程守护监控的安装与使用
supervisor进程守护监控的安装与使用简介centos7安装与配置安装yum install supervisor -y配置supervisord服务的配置文件vim /etc/supervisord.conf ; Sample supervisor config file.[unix_http_server]file=/var/run/supervisor/supervisor.sock ; (the path to the socket file);ch原创 2021-06-16 11:16:43 · 322 阅读 · 0 评论 -
Ubuntu 16.04安装docker
Ubuntu 16.04安装docker1. 清理环境apt-get remove docker docker-engine docker.io2. 安装应用软件apt-get install \ apt-transport-https \ ca-certificates \ curl \ software-properties-common3. 添加Docker的官方GPG keycurl -fsSL https://download.docker.co原创 2021-04-13 14:36:41 · 351 阅读 · 0 评论 -
Python报错TypeError: unsupported operand type(s) for -=: ‘Retry‘ and ‘int‘
Python报错TypeError: unsupported operand type(s) for -=: ‘Retry’ and ‘int’新搭建的Ubuntu16.04系统,执行pip install oss2 paho-mqtt requests,报错:Python报错TypeError: unsupported operand type(s) for -=: ‘Retry’ and ‘int’解决办法:创建pip.conf文件夹mkdir ~/.pip添加pip国内源 cat原创 2021-04-13 14:23:19 · 888 阅读 · 0 评论 -
ubuntu14.04安装FTP
ubuntu14.04 安装FTPapt-get install vsftpd -yservice vsftpd restartmkdir /home/idriveruseradd -d /home/idriver -s /bin/bash idriverpasswd idriverrm /etc/pam.d/vsftpdusermod -s /sbin/nologin idrivervim /etc/vsftpd.confchroot_local_user=YESuserlist_d原创 2020-05-13 08:46:07 · 627 阅读 · 0 评论 -
如何解决vim中文乱码
centos7 vim中文乱码vim ~/.vimrc添加下面内容set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936set termencoding=utf-8set encoding=utf-8保存即可原创 2020-07-28 10:18:01 · 615 阅读 · 0 评论 -
-bash: ll: command not found 解决方案
-bash: ll: command not found 解决方案vim ~/.bashrc#添加下面内容alias ll='ls -l'执行source ~/.bashrc原创 2020-09-09 18:57:10 · 1263 阅读 · 0 评论 -
ubuntu安装turnserver服务
ubuntu安装turnserver服务环境:ubuntu16.04apt-get install -y libssl-dev libevent-devwget http://coturn.net/turnserver/v4.5.0.7/turnserver-4.5.0.7.tar.gztar xfz turnserver-4.5.0.7.tar.gzcd turnserver-4.5.0.7./configure make && make install#启动nohup原创 2020-09-09 18:50:07 · 1204 阅读 · 0 评论 -
如何给ubuntu下非root用户添加java11的环境变量
如何给ubuntu下非roos用户添加java11的环境变量1.添加用户输入密码adduser test2.下载上传安装包(1).下载链接:https://pan.baidu.com/s/1BkVHFXEst3Q17OiCwf7xDA 提取码:7l8c (2)上传的用户目录cd /home/testtar zxvf jdk-11.0.8_linux-x64_bin.tar.gzsu test3.配置环境cat << EOF > ~/.bash_profilee原创 2020-08-12 12:08:27 · 1014 阅读 · 2 评论 -
docker容器时间与主机时间不一致
docker容器时间与主机时间不一致1.将主机的时间目录cp到容器内docker cp /etc/localtime 容器id或者容器名:/etc/localtimedocker restart 容器id或容器名2.进行软连接docker exec -it 容器id或容器名 /bin/bashln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime3.验证date...原创 2020-08-12 11:41:42 · 634 阅读 · 0 评论 -
docker容器搭建ROS环境
Dockerfile制作ros镜像1.准备ubuntu16.04的基础镜像docker pull ubuntu:16.042.创建Dockerfile文件mkdir -p /opt/Dockerfilecat << EOF > /opt/Dockerfile/DockerfileFROM ubuntu:16.04MAINTAINER yournameRUN apt-get updateRUN apt-get -y install curl vim net-tools原创 2020-08-12 10:50:05 · 3654 阅读 · 2 评论 -
解决Connection to pypi.org timed out问题
解决Connection to pypi.org timed out问题pip install pymysql 报下面问题WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by‘ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnect原创 2020-08-07 18:30:09 · 12751 阅读 · 7 评论 -
MySQL慢查询日志每天定时切割
MySQL慢查询日志每天定时切割#ubuntu安装crontapt-get install croncront start#centos安装crontyum -y install cronieyum -y install yum-croncrond startvim /opt/cut_mysql_slow_log.sh#添加下面内容time=`date -d yesterday +"%Y-%m-%d"`user="user"passwd="passwd"#提前创建好一个存放目录:原创 2020-07-20 15:23:37 · 885 阅读 · 0 评论 -
apache添加访问密码
apache2 添加访问密码**首先确认是否有apache和htpasswd****安装apache、htpasswd**apt-get install apache2apt-get install libapache-htpasswd-perlapt-get updateapt-get install apache2-utilsvim /etc/apache2/sites-available/000-default.conf**添加下面内容**<VirtualHost *:por原创 2020-07-17 14:42:02 · 1153 阅读 · 0 评论 -
ubuntu16.04 安装Pyhton3.7
ubuntu16.04 安装Pyhton3.7cd /optwget https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tgztar -zxvf Python-3.7.1.tgzcd Python-3.7.1./configure --prefix=/opt/python3.7makemake installln -s /opt/python3.7/bin/python3.7 /usr/bin/pythonpython -V..原创 2020-07-13 10:17:41 · 556 阅读 · 0 评论 -
ubuntu cache内存占用过大
free -m默认是0,1表示清空页缓存,2表示清空inode和目录树缓存,3清空所有的缓存echo 1 > /proc/sys/vm/drop_cachesecho 2 > /proc/sys/vm/drop_cachessyncecho 3 > /proc/sys/vm/drop_caches根据需要清除缓存,设置后系统不允许重新设为0了,不过重启系统后默认又是为0在执行下free -m 可以看到cached变小了,free变多了...原创 2020-06-18 14:51:42 · 1744 阅读 · 0 评论 -
Ubuntu14.04 源码安装 PHP7.2
1.下载PHP源码首先需要从PHP官网下载PHP7.2.31的源代码,保存为php-7.2.31.tar.xz。wget https://www.php.net/distributions/php-7.2.31.tar.xztar -xvJf ./php-7.2.31.tar.xzcd php-7.2.312.安装依赖sudo apt-get update && apt-get install -y gcc make openssl \curl libbz2-dev libx原创 2020-06-11 11:23:31 · 1769 阅读 · 1 评论 -
服务器vim乱码
ubuntu14.04 vim乱码vim /etc/vim/vimrc 末尾添加 set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936 set termencoding=utf-8 set encoding=utf-8原创 2020-05-13 13:47:36 · 680 阅读 · 0 评论 -
根目录被加密的处理方法
根目录被加密的处理方法ecryptfs-unwrap-passphrase保留密码串*********************切换到root用户cd /homemkdir idriver-slave-bakecryptfs-add-passphrase --fnek复制密码串Inserted auth tok with sig [f5ac2fe577f16aa3] into the user session keyringInserted auth tok with sig [bc45原创 2020-05-13 13:41:41 · 1087 阅读 · 0 评论