开发常用笔记

开机自动启动xx脚本

vim  /etc/rc.local
#例如每次开机自动启动nginx和mysql,直接把启动命令扔进来即可
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
/usr/local/php/sbin/php-fpm

怎样修改history最大保留数呢
默认hisroty 是1000条

hisroty -c       #干掉全部history历史
vim /etc/profile #修改HISTSIZE=999999
source /etc/profile  #重新加载配置文件生效

主机与虚拟主机之间通讯,ssh登录sftp登录,最简单的办法
1.选择桥接网路,可以保证本机和虚拟主机在同一个网段
2.安装ssh**(PS默认没有安装的哦)**

ubantu apt-get install ssh
centos yum -y install ssh
ps  -ef|grep ssh 查看是否安装成功,安装成功默认自动启动的

用户管理 https://www.cnblogs.com/xiohao/p/5877256.html
cat /etc/passwd 查看所有用户和所在组等信息

useradd zhangsan 添加张三用户
groupadd boys 添加boys分组
usermod -G boys zhangsan 把张三添加到boys组
userdel
ssh公钥配置(用于git 提交和拉取代码的时候不需要输入密码):
[root@iZtqas3cjxy7mbZ html]# ssh-keygen -t rsa -C [email protected]
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
/root/.ssh/id_rsa already exists.
Overwrite (y/n)?
cd /root/.ssh/
[root@iZtqas3cjxy7mbZ .ssh]# ls
id_rsa id_rsa.pub known_hosts
[root@iZtqas3cjxy7mbZ .ssh]# cat id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDTOKEnKT4+lw5fW/kPhXL/wuqc4jxyqba0IkWpaiYO5/ff4jfIeOfp88ioGtkiI18oxgLjCvtYpkgoJPIw4mg2ewmqCMLHfxy0F6Kd2V+2UqqBmDExXqnrUR4ZEBHHJDvS01dCboOPPZQxnmyjtYuE6tCj/0R/cO++GzjTa4E/ne+G8FQP7/p7mf2dqhoMXtxOYGd4oApwAMn55xbwGYnECu5DAtZEmfeLQd/H6rIhKwuAjTAjWGz9GBNwuOw1ozM+SQ3ZpGUM61b3h9hNryUxfBBZiaEQ/dHnW/tY7rd/tdjDH7JhCdabL2POt9nc9eg49q/UNyNx/Bl5fD3y5WVR [email protected]
复制公钥到gitlab/github/coding等代码仓库
(未完待续。。。)

猜你喜欢

转载自blog.csdn.net/qq_27517377/article/details/79940382