排序
L30※甲骨文云开启root登录
echo root:密码 | sudo chpasswd root sudo sed -i 's/^#?PermitRootLogin./PermitRootLogin yes/g' /etc/ssh/sshd_config sudo sed -i 's/^#?PasswordAuthentication./PasswordAuthentication ...
L08※定时执行文件
1> 设置个人任务调度 crontab -e 30 8 * * * /usr/local/anaconda3/bin/python3 /data/jupyter/scrapy/weather.py 项目含义范围第一个*一小时当中的第几分钟0-59第二个*一天当中的第几个小时...
L33※镜像源
1> python 国内镜像源 ① 手动配置 vim /root/.pip/pip.conf [global] index-url = https://pypi.tuna.tsinghua.edu.cn/simple [install] trusted-host = https://pypi.tuna.tsinghu...
L14※ubuntu 修改ip地址
1> ubuntu 18.04 ① 修改配置文件/etc/network/interfaces vim /etc/network/interfaces auto lo iface lo inet loopback auto eth0 #设置自动启动eth0接口,eth0根据ifconfig中的网卡名进行...
L35※设置或删除swap虚拟内存
1> 创建swap文件 ① 创建 Swap 文件 #创建swap文件,分区大小为4G sudo dd if=/dev/zero of=/swapfile count=4096 bs=1M ② 激活 Swap 文件 sudo chmod 600 /swapfile sudo mkswap /swapfile ③...
L15※vps开放端口
1> 安装iptables sudo apt-get install iptables sudo yum install iptables 2> ubuntu或者debian ① 新建规则文件 vim /etc/iptables/rules.v4 -A INPUT -p tcp -m state --state NEW -m tc...
L39※禁止Debian 11自动休眠
1> 查看休眠状态 systemctl status sleep.target 2> 设置禁止休眠 systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
L17※ubuntu开启root登录
1> 设置 root 账户密码 sudo passwd root 2> 修改 .profile vim /root/.profile # mesg n || true tty -s && mesg n || true 3> 修改 gdm-autologin 和 gdm-password cd /etc/...
L43※Putty使用密钥登陆SSH
1> 使用putty生成公钥和私钥 2> 配置远程主机 将上一步保存的公钥保存在~/.ssh/authorized_keys文件中 chmod 400 ~/.ssh/authorized_keys 3> 使用sudo时不输入密码 在/etc/sudoers文件中增加(u...
L18※ubuntu挂载新硬盘
1> 查找新添加的盘符 # root用户 fdisk -l # 查看新硬盘 blkid # 定位或打印块设备的属性,查看硬盘uuid 2> 格式化新硬盘文件系统: mkfs -t ext4 /dev/sda 3> 挂载硬盘...