ssh免密码:
创建密钥
ssh-keygen -t rsa
一直回车
复制公钥要指定IP地址
ssh-copy-id -i .ssh/id_rsa.pub root@192.168.254.135
输入密码
测试
ssh root@192.168.254.135
git拉取和上传代码:
下载相应的应用目录及文件
git clone git@node.abc.com:root/test.git
更新数据包(拉取数据)
cd 到相应目录
git pull
git status
初始化本地git目录、并添加远程仓库
git init
git remote add origin git@node.abc.com:root/test.git
上传代码
git status
git add .
git commit -m "x" 删除
git commit -m "add new feile" 新增
git pull 拉取
git push 推送
git commit -m 'update'
git push origin master
上传文件
进入到项目目录
cd test/
创建需要上传到GitLab中的目标文件
echo “test” > /root/test.sh
将目标文件或者目录拷贝到项目目录下
cp /root/test.sh ./
将test.sh文件加入到索引中
git add test.sh
将test.sh提交到本地仓库
git commit -m “test.sh”
将文件同步到GitLab服务器上
git push -u origin master
时间同步:
yum -y install ntp
定时任务
每小时同步一次
crontab -e
- 1 * /usr/sbin/ntpdate pool.ntp.org >/dev/null 2>&1
systemctl start ntpd
转载于:https://blog.51cto.com/10158955/2148083