Skip to content

Commit

Permalink
update lsattr & git ssh key
Browse files Browse the repository at this point in the history
  • Loading branch information
lcp0578 committed Feb 23, 2020
1 parent dcd5208 commit 61d6e9a
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 17 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@
- [Overview of Partitioning in MySQL](src/MySQL/partitioning.md)
- [sql prepare](src/MySQL/sql-prepare.md)
- [Limits on Table Column Count and Row Size](src/MySQL/ColumnCountAndRowSize.md)
- [MySQL8 rpm install](src/MySQL/mysql8_rpm_install.md)
4. [composer](src/composer/README.md "composer")
- [composer basic](src/composer/basic.md) composer基础使用
- [composer config](src/composer/config.md) composer配置相关
Expand Down Expand Up @@ -242,6 +243,7 @@
- [history](src/Linux/history.md)
- [sed](src/Linux/sed.md)
- [rz & sz](src/Linux/rzsz.md)
- [chattr & lsattr](src/Linux/chattr.md)
- [iconv](src/Linux/iconv.md)
- [Aliyun服务器配置IPV6](src/Linux/ipv6_aliyun.md)
- [chinese support](src/Linux/chinese_support.md) 中文支持
Expand Down
1 change: 1 addition & 0 deletions src/Linux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- [history](history.md)
- [sed](sed.md)
- [rz & sz](rzsz.md)
- [chattr & lsattr](chattr.md)
- [iconv](iconv.md)
- [Aliyun服务器配置IPV6](ipv6_aliyun.md)
- [chinese support](chinese_support.md) 中文支持
Expand Down
13 changes: 11 additions & 2 deletions src/Linux/chattr.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## chattr
## chattr & lsattr
- 介绍
在Linux ext文件系统中,权限控制除了常规的chmod,还会有文件属性管理,故出现了chattr命令。
在linux系统中,内核在2.6以上的,均可执行此命令。通过chattr命令修改属性能够提高系统的安全性,但是它并不适合所有的目录。chattr命令不能保护/、/dev、/tmp、/var目录。lsattr命令是显示chattr命令设置的文件属性。
Expand All @@ -21,4 +21,13 @@
总用量 8
drwxr-xr-x 2 www www 4096 5月 23 09:41 .
drwxr-xr-x 38 root root 4096 5月 13 14:43 ..
```
```
- 用chattr命令防止系统中某个关键文件被修改:
# chattr +i /etc/resolv.conf
- 使用 lsattr 命令来显示文件属性:
# lsattr /etc/resolv.conf
- 让某个文件只能往里面追加数据,但不能删除,适用于各种日志文件:
# chattr +a /var/log/messages
3 changes: 2 additions & 1 deletion src/MySQL/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@
- [MySQL 8 新特性 Window Functions](WindowFunctions.md)
- [Overview of Partitioning in MySQL](partitioning.md)
- [sql prepare](sql-prepare.md)
- [Limits on Table Column Count and Row Size](ColumnCountAndRowSize.md)
- [Limits on Table Column Count and Row Size](ColumnCountAndRowSize.md)
- [MySQL8 rpm install](mysql8_rpm_install.md)
31 changes: 24 additions & 7 deletions src/MySQL/mysql8_rpm_install.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,27 @@
$ rpm -e --nodeps mariadb-libs-8.0.15-2.el7_0.x86_64
- 官网下载 rpm包 mysql-8.0.19-1.el7.x86_64.rpm-bundle.tar

rpm -ivh mysql-community-common-8.0.19-1.el7.x86_64.rpm
rpm -ivh mysql-community-embedded-compat-8.0.19-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-8.0.19-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-compat-8.0.19-1.el7.x86_64.rpm
rpm -ivh mysql-community-devel-8.0.19-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-8.0.19-1.el7.x86_64.rpm
rpm -ivh mysql-community-server-8.0.19-1.el7.x86_64.rpm
$ rpm -ivh mysql-community-common-8.0.19-1.el7.x86_64.rpm
$ rpm -ivh mysql-community-embedded-compat-8.0.19-1.el7.x86_64.rpm
$ rpm -ivh mysql-community-libs-8.0.19-1.el7.x86_64.rpm
$ rpm -ivh mysql-community-libs-compat-8.0.19-1.el7.x86_64.rpm
$ rpm -ivh mysql-community-devel-8.0.19-1.el7.x86_64.rpm
$ rpm -ivh mysql-community-client-8.0.19-1.el7.x86_64.rpm
$ rpm -ivh mysql-community-server-8.0.19-1.el7.x86_64.rpm
- 操作命令:
- 开启:`systemctl start mysqld`
- 停止:`systemctl stop mysqld`
- 重启:`systemctl restart mysqld`
- 修改数据存储的配置
- 由:

datadir=/var/lib/mysql
- 改为:

datadir=/home/data/mysql
- 修改权限
$ chown –R mysql:mysql /home/data/mysql



20 changes: 13 additions & 7 deletions src/git/git_ssh.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
## git ssh
有时,我们会修改ssh的默认端口号,那么我们在使用git clone git@gitee.com:lcp0578/test会失败。
需要修改配置项:
- 生成SSH Key

cat>~/.ssh/config
# 映射一个别名
host gitee.com
hostname gitee.com
port 22
$ ssh-keygen -t rsa -C "lcp0578@gmail.com"
- 获取SSH Key

$ cat id_rsa.pub
- 有时,我们会修改ssh的默认端口号,那么我们在使用git clone git@gitee.com:lcp0578/test会失败。
需要修改配置项:

cat>~/.ssh/config
# 映射一个别名
host gitee.com
hostname gitee.com
port 22

0 comments on commit 61d6e9a

Please sign in to comment.