0%

firewall

配置firewalld

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59

firewall-cmd --version # 查看版本
firewall-cmd --help # 查看帮助

# 查看设置:
firewall-cmd --state # 显示状态
firewall-cmd --get-active-zones # 查看区域信息
firewall-cmd --get-zone-of-interface=eth0 # 查看指定接口所属区域
firewall-cmd --panic-on # 拒绝所有包
firewall-cmd --panic-off # 取消拒绝状态
firewall-cmd --query-panic # 查看是否拒绝

firewall-cmd --reload # 更新防火墙规则
firewall-cmd --complete-reload
# 两者的区别就是第一个无需断开连接,就是firewalld特性之一动态添加规则,第二个需要断开连接,类似重启服务


# 将接口添加到区域,默认接口都在public
firewall-cmd --zone=public --add-interface=eth0
# 永久生效再加上 --permanent 然后reload防火墙

# 设置默认接口区域,立即生效无需重启
firewall-cmd --set-default-zone=public

# 查看所有打开的端口:
firewall-cmd --zone=dmz --list-ports

# 加入一个端口到区域:
firewall-cmd --zone=dmz --add-port=8080/tcp
# 若要永久生效方法同上

# 打开一个服务,类似于将端口可视化,服务需要在配置文件中添加,/etc/firewalld 目录下有services文件夹,这个不详细说了,详情参考文档
firewall-cmd --zone=work --add-service=smtp

# 移除服务
firewall-cmd --zone=work --remove-service=smtp

# 显示支持的区域列表
firewall-cmd --get-zones

# 设置为家庭区域
firewall-cmd --set-default-zone=home

# 查看当前区域
firewall-cmd --get-active-zones

# 设置当前区域的接口
firewall-cmd --get-zone-of-interface=enp03s

# 显示所有公共区域(public)
firewall-cmd --zone=public --list-all

# 临时修改网络接口(enp0s3)为内部区域(internal)
firewall-cmd --zone=internal --change-interface=enp03s

# 永久修改网络接口enp03s为内部区域(internal)
firewall-cmd --permanent --zone=internal --change-interface=enp03s


服务管理

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# 显示服务列表  
Amanda, FTP, Samba和TFTP等最重要的服务已经被FirewallD提供相应的服务,可以使用如下命令查看:

firewall-cmd --get-services

# 允许SSH服务通过
firewall-cmd --new-service=ssh

# 禁止SSH服务通过
firewall-cmd --delete-service=ssh

# 打开TCP的8080端口
firewall-cmd --enable ports=8080/tcp

# 临时允许Samba服务通过600秒
firewall-cmd --enable service=samba --timeout=600

# 显示当前服务
firewall-cmd --list-services

# 添加HTTP服务到内部区域(internal)
firewall-cmd --permanent --zone=internal --add-service=http
firewall-cmd --reload # 在不改变状态的条件下重新加载防火墙


端口管理

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# 打开443/TCP端口
firewall-cmd --add-port=443/tcp --permanent

# 永久打开3690/TCP端口
firewall-cmd --permanent --add-port=3690/tcp --permanent

# 永久打开端口好像需要reload一下,临时打开好像不用,如果用了reload临时打开的端口就失效了
# 其它服务也可能是这样的,这个没有测试
firewall-cmd --reload

# 查看防火墙,添加的端口也可以看到
firewall-cmd --list-all


all

1
2
3
4
5
systemctl enable firewalld
systemctl start firewalld
firewall-cmd --add-port=443/tcp --permanent
firewall-cmd --add-port=80/tcp --permanent
firewall-cmd --add-port=7002/tcp --permanent

zone

增加一个zone

1
firewall-cmd --new-zone=zgcw-access --permanent

增加ip和端口

gateway

1
2
3
4
5
6
firewall-cmd --zone=zgcw-access --add-source=172.17.100.0/24 --permanent
firewall-cmd --zone=zgcw-access --add-port=9939/tcp --permanent
firewall-cmd --zone=zgcw-access --add-port=7001/tcp --permanent
firewall-cmd --zone=zgcw-access --add-port=7002/tcp --permanent
firewall-cmd --zone=zgcw-access --add-port=8091-8094/tcp --permanent
firewall-cmd --reload

work1、work2

1
2
3
firewall-cmd --zone=zgcw-access --add-source=172.17.100.0/24 --permanent
firewall-cmd --zone=zgcw-access --add-port=8091-8094/tcp --permanent
firewall-cmd --reload

ip段

1
2
3
4
5
172.17.100.218
172.17.100.222 work1
172.17.100.223 work2
172.17.100.220 es
172.17.86.0

这里看到

进入TEWA-800E的管理页面,发现只能使用默认用户user登陆,而user没有修改路由模式的权限,现在的问题就是想办法登陆超级用户了,查到超级用户账号密码为CUAdmin/CUAdmin。以前似乎可以使用cu.html来登陆,但我试了下,现在(2018年6月底)应该是已经封掉了。
Chrome打开光猫登陆页面,默认是192.168.1.1,F12进入开发工具,在source中可以看到user_name固定为user,且提交时还加了对用户名的验证。 找到对应的代码,拷贝到console,修改user_name的值为CUAdmin,去掉用户名的验证。

就是在console中执行

1
2
3
4
5
6
7
document.getElementById('user_name').value= 'CUAdmin';
function submitFrm()
{
document.getElementById('loginfrm').submit();
}


就进入管理界面

上行管理中设置第二个连接为桥接方式,保存就可以了。
然后在自己的路由器中设置wlan为ppoe方式,填上用户名密码就行了。

了解一下:
Windows service wrapper
这个软件可以把任何程序作为服务运行,首先下载exe执行文件,我的执行文件命名:customs.exe
创建customs.xml

1
2
3
4
5
6
7
8
<service>
<id>Customs</id>
<name>Customs</name>
<description>This runs Spring Boot Customs as a Service.</description>
<executable>java</executable>
<arguments>-Xmx256m -jar -Dspring.profiles.active=test "c:\jenkins\soft\customs\customs.jar"</arguments>
<logmode>rotate</logmode>
</service>

然后执行安装服务命令

1
2
3
C:\jenkins\soft\customs>customs install
2018-11-30 11:11:23,416 INFO - Installing the service with id 'Customs'

启动服务

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
C:\jenkins\soft\customs>customs start
2018-11-30 11:12:42,031 INFO - Starting the service with id 'Customs'

C:\jenkins\soft\customs>dir
驱动器 C 中的卷没有标签。
卷的序列号是 BCFA-AA62

C:\jenkins\soft\customs 的目录

2018/11/30 11:12 <DIR> .
2018/11/30 11:12 <DIR> ..
2018/11/30 11:12 0 customs.err.log
2018/11/30 11:06 360,448 customs.exe
2018/11/30 10:37 39,628,558 customs.jar
2018/11/30 11:12 978 customs.out.log
2018/11/30 11:12 1,612 customs.wrapper.log
2018/11/30 11:09 367 customs.xml

其中customs.out.log 是spring boot 的执行日志,customs.err.log是错误日志
customs.wrapper.log是service wrapper 的执行日志

看到目录名是jenkins开头的,其实这个项目是用jenkins做CI的,在windows节点执行,要求windows节点接入的时候用管理员身份执行,项目用maven打包完成后添加一个windows shell任务
shell脚本如下:

1
2
3
4
5
6
7
8
9
10
rem copy jar to c:\jenkins\customs\customs.jar
copy target\customs-0.0.1-SNAPSHOT.jar c:\jenkins\soft\customs\customs.jar
rem 进入工作目录
cd c:\jenkins\soft\customs

rem 停止服务
customs stop

rem 启动服务
customs start

fabric 国密改造

代码仓库(限制权限的私人仓库)

国密改造补丁:ssh://gitlabs.my118.com:9022/wanghongxing/fabric-sm-patch.git

国密版代码:ssh://git@gitlabs.my118.com:9022/wanghongxing/fabric.git

java sdk 国密版代码仓库 ssh://git@gitlabs.my118.com:9022/blockchain/fabric-sdk-java.git

fabric国密改造包括:源代码改造、sdk改造、ca改造。

Fabric源代码改造的大致清单

主要涉及一下目录及文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
bccsp/factory/gmfactory.go                    
bccsp/factory/nopkcs11.go
bccsp/factory/pkcs11.go
bccsp/gm/fileks.go
bccsp/gm/impl.go
bccsp/gm/keys.go
bccsp/gm/sm2.go
bccsp/gm/sm2key.go
bccsp/gm/sm3sig.go
bccsp/sm2opts.go
bccsp/utils/keys.go
cmd/common/signer/signer.go
common/tools/cryptogen/ca/generator.go
common/tools/cryptogen/ca/generatorsm.go
common/tools/cryptogen/csp/csp.go
common/tools/cryptogen/csp/cspsm.go
common/tools/cryptogen/main.go
common/tools/cryptogen/mainsm.go
common/tools/cryptogen/msp/generator.go
common/tools/cryptogen/msp/generatorsm.go
core/chaincode/shim/ext/attrmgr/attrmgr.go
core/chaincode/shim/ext/cid/cid.go
core/chaincode/shim/ext/cid/interfaces.go
core/common/validation/msgvalidation.go
msp/cert.go
msp/identities.go
msp/mspimpl.go
msp/mspimplsetup.go
msp/mspimplvalidate.go
vendor/github.com/wanghongxing/crypto/sm/sm2/
vendor/github.com/wanghongxing/crypto/sm/sm3/
vendor/github.com/wanghongxing/crypto/sm/sm4/
vendor/github.com/wanghongxing/crypto/x509/

大致功能

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#bccsp中功过SW方式切换成国密
bccsp/factory/
#基本国密bccsp库
bccsp/gm/
#bccsp中增加sm2的常量
bccsp/sm2opts.go
bccsp/utils/keys.go
#消息验证增加国密
core/common/validation/msgvalidation.go
#msp证书对国密的支持
msp/cert.go
msp/identities.go
msp/
#国密算法,第三方拿过来修改了包名
vendor/github.com/wanghongxing/crypto/sm/
#国密x509证书 ,第三方拿过来修改了包名
vendor/github.com/wanghongxing/crypto/x509/
#discover国密支持
cmd/common/signer/signer.go
#生成证书工具改造
common/tools/cryptogen/
#chaincode中访问证书支持国密
core/chaincode/shim/ext/attrmgr/attrmgr.go
core/chaincode/shim/ext/cid/cid.go
core/chaincode/shim/ext/cid/interfaces.go


fabric国密补丁工程

fabric 官方源代码 fabric1.4.2 下能正常apply入原始项目中,到了fabric1.4.4以后,msp/mspimplvalidate.go 文件不能打入布丁,手动修改后正常.

为了保证以后版本能够正常打入官方发布版本,决定每个版本进行修订,修订包名称定为:

fabric-x.x.x-000xxxx.patch

同时依赖的crypto/sm crypto/x509决定克隆到自己的 git 目录下,确保版本稳定。

1.4.4 补丁

整理后三个patch包如下:

1
2
3
fabric-1.4.4-0001-china-crypto-standards-support-1.4.4.patch
fabric-1.4.4-0002-gm-ecdsa-chaincode.patch
fabric-1.4.4-0003-change-discover-support-gm.patch

分别完成了基本的国密支持、chaincode中证书支持国密、discover中证书支持国密。

使用方法

从fabric官方签出1.4.4的代码

1
git checkout v1.4.4

然后把patch文件复制到fabric父目录下,然后执行

1
2
3
git am ../fabric-sm-patch/fabric-1.4.4-0001-china-crypto-standards-support-1.4.4.patch
git am ../fabric-sm-patch/fabric-1.4.4-0002-gm-ecdsa-chaincode.patch
git am ../fabric-sm-patch/fabric-1.4.4-0003-change-discover-support-gm.patch

1.4.6/1.4.7 版本

整理后有一个patch包

1
fabric-1.4.7-0001-china-crypto-standards-support-1.4.7.patch

使用方法

从官方签出1.4.7代码(注,1.4.7还没有打tag,所以暂时用release-1.4)

1
git chekcout release-1.4

或者(注,1.4.7还没有打tag,所以暂时用v1.4.6)

1
git checkout v1.4.6

然后把patch文件复制到fabric父目录下,然后执行

1
git am ../fabric-sm-patch/fabric-1.4.7-0001-china-crypto-standards-support-1.4.7.patch

fabric国密版本编译

编译环境建立

fabirc的编译需要在ubuntu虚拟机里进行编译,所以先要安装virtualbox和vagrant,安装完以后理论上就可以进入devenv目录目录运行虚拟机。

但是,因为我们伟大的qiang,所以要想编译环境运行好,就先要装fan qiang软件。

我安装了:

小飞机Shadowsocks,这个是作为翻墙用的,但是它只监听127.0.0.1,为了让虚拟机的软件用,我们还要转另外一个东东“privoxy”,让这个东东监听ipv4的端口,我用它监听8118端口,

1
2
3
4
brew install privoxy
#修改配置文件vim /usr/local/etc/privoxy/config
listen-address 0.0.0.0:8118
forward-socks5 / localhost:1080 .

然后修改fabric 的 devenv/Vagrant文件,在这行Vagrant.configure('2') do |config|后面添加着两行:

1
2
# config.proxy.http     = "http://10.0.0.9:8118/"
# config.proxy.https = "http://10.0.0.9:8118/"

注意,#去掉以后起作用,加上就不起作用了,为什么要说加上#不起作用呢?不加不久完了吗?

问题就在这里:

下载github google之类的东东,需要打开;

下载ubuntu系统之类的软件,需要关闭;

就是这么麻烦,如果你的fan qiang线路特别好,就一直打开。否则最简单的就是关闭的时候执行到一半不行了,就打开;打开的时候执行到一半不行了,就关闭。周而复始吧~(fuck)

建好了墙,按理说就可以直接开启虚拟机了,慢~先把Vagrant中

1
2
3
4
5
6
$script = <<SCRIPT
set -x
echo "127.0.0.1 couchdb" | tee -a /etc/hosts
cd #{SRCMOUNT}/fabric/devenv
./setup.sh
SCRIPT

其中./setup.sh这行注释掉,因为在虚拟机启动的时候它就调用,出错了后你都不知道干啥好,出不去进不来的,就像被卡在门缝中一样。

把它注释掉后,进入虚拟机后自己手动执行。

下面启动虚拟机

1
vagrant up

第一次的话需要下载镜像,启动完成后执行进入。

1
vagrant ssh

然后开始慢慢的执行devenv/setup.sh

执行出错后,慢慢手动开关代理,然后粘贴命令执行就行,最后这个东西执行完了之后,编译环境就算创建完了。

编译fabric执行程序

直接执行:

1
make native

这个会把fabric 可执行程序编译好后放在.build/bin/目录下,包括常用的cryptogen configtxgen configtxlator

编译docker镜像

直接执行

1
make docker

这个一般网络不行都会出错,出错以后如果是下载github google之类的错误就打开代理,否则就关闭代理。

如果提示找不到.build/xxx/gotools/目录下的什么文件,这就是在代理切换的过程中,因为脚本文件把创建目录作为执行完的标记,所以没有执行成功下次也不会执行。解决办法就是删除它提示找不到文件的那个目录,大概率就是.build/docker/gotools目录。反正就是github google需要qiang,ubuntu系统文件不能用qiang,因为这些网站dns失败,我也没有细究,手动解决就OK。

打包镜像文件

为了方便大家使用,编译好之后需要把可执行程序和镜像保存起来供大家用,如下命令把所有可执行文件复制到fabric/devenv/bin,然后把镜像保存到:

fabric/devenv/fabric-gm-1.4.7-20200506.tar.gz

1
2
3
4
5
mkdir /vagrant/bin/
cp .build/bin/* /vagrant/bin/

docker save $(docker images | sed '1d' | awk '{print $1 ":" $2 }') | \
gzip -c > /vagrant/fabric-gm-1.4.7-20200506.tar.gz

java sdk国密改造

代码仓库 ssh://git@gitlabs.my118.com:9022/blockchain/fabric-sdk-java.git

改造思路

fabric java sdk使用 bouncycastle 作为加密库,因为bouncycastle 本身已经支持国密的算法,所以只用在fabric java sdk中添加对加密算法、hash算法、证书类型的判断即可。

但是:因为bouncycastle必须手动加载早java security系统中,所以应用程序应该在启动的时候调用如下代码加载Security.addProvider(new BouncyCastleProvider());。否则就会提示类似于不可识别的证书、不支持的算法等莫名其妙的错误提示。

Config改造

java sdk启动的时候在 config.properties 文件查找配置选项,比较有用的几个是:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

# security level determines the elliptic curve used to generate keys. Valid values are 256 ( curve is P-256 )
# and 384 ( curve is secp384r1 )
org.hyperledger.fabric.sdk.crypto.security_level = 256
# hash algorithm determines the message digest used when creating a signature. Valid values are
# SHA2 ( digest is SHA-256 ) and SHA3 ( digest is SHA-3 )
org.hyperledger.fabric.sdk.crypto.hash_algorithm = SHA2
# The format for the certificate PEM files used by the SDK, Fabric and Fabric-ca components.
# currently X.509 is the only valid format supported. This entry is here to allow for future support
# org.hyperledger.fabric.sdk.crypto.certificate_format = X.509
# The algorithm used to generate a signature. Valid values are listed in the JCA Standard Algorithm Name Documentation
# e.g. http://docs.oracle.com/javase/8/docs/technotes/guides/security/StandardNames.html#Signature
org.hyperledger.fabric.sdk.crypto.default_signature_algorithm = SHA256withECDSA


上面的配置是缺省的椭圆曲线配置,为了满足国密支持,我们需要支持如下配置

1
2
3
org.hyperledger.fabric.sdk.crypto.default_signature_algorithm = SM3withSM2
org.hyperledger.fabric.sdk.hash_algorithm = SM3
org.hyperledger.fabric.sdk.security_level=255

security_level=255 是为了避免跟椭圆曲线冲突。

相应的我们需要在Config.java文件中修改加密曲线配置,增加255=sm2p256v1

1
2
3
//defaultProperty(SECURITY_CURVE_MAPPING, "256=secp256r1:384=secp384r1");
defaultProperty(SECURITY_CURVE_MAPPING, "256=secp256r1:384=secp384r1:255=sm2p256v1");

这样系统看到security_level=255 就知道使用 sm2p256v1 加密曲线。

加密套件修改

验证证书

在验证证书的时候CertPathValidator 不能使用缺省的,需要使用bouncycastle 提供的。

1
2
3
4
//CertPathValidator certValidator = CertPathValidator.getInstance(
CertPathValidator.getDefaultType()); // PKIX
CertPathValidator certValidator = CertPathValidator.getInstance(\
CertPathValidator.getDefaultType(), "BC"); // PKIX

配置哈希算法

需要添加sm3的判断

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
void setHashAlgorithm(String algorithm) throws InvalidArgumentException {

// whx: 添加SM3

if (isNullOrEmpty(algorithm)
|| !("SHA2".equals(algorithm)
|| "SHA3".equals(algorithm)
|| "SM3".equals(algorithm)
)) {
throw new InvalidArgumentException("Illegal Hash function family: "
+ algorithm + " - must be either SHA2 or SHA3 or SM3");
}

hashAlgorithm = algorithm;
}

椭圆曲线证书转换的时候

标准算法转换的时候有这么一句,在国密里面要注释掉,否则验证签名会失败。

1
sigs = preventMalleability(sigs, curveN);

证书工厂配置

修改为之支持x509,由 bouncycastle 提供。

1
2
//            cf = CertificateFactory.getInstance(CERTIFICATE_FORMAT);
cf = CertificateFactory.getInstance("X509", "BC");

增加固定的sha256

因为在提交交易的时候,交易的哈希是固定的sha256,但做签名的时候根据证书使用,所以在这里添加一个sha256,在交易提交的时候调用

1
2
3
4
5
6
7
8
9
//whx 做一个固定的sha256哈希
@Override
public byte[] hashSha256(byte[] input) {
Digest digest = new SHA256Digest();
byte[] retValue = new byte[digest.getDigestSize()];
digest.update(input, 0, input.length);
digest.doFinal(retValue, 0);
return retValue;
}

提交交易的时候:

1
2
3
public TransactionContext(Channel channel, User user, CryptoSuite cryptoPrimitives) {

byte[] txh = cryptoPrimitives.hashSha256(comp.toByteArray());

配置文件

config.properties 作为java sdk的配置文件,缺省在jar执行文件的当前目录,如果没有,就是按照标准的椭圆曲线证书支持;否则,就必须单独做配置文件,如下是标准的国密算法配置内容:

上面的配置是缺省的椭圆曲线配置,为了满足国密支持,我们需要支持如下配置

1
2
3
org.hyperledger.fabric.sdk.crypto.default_signature_algorithm = SM3withSM2
org.hyperledger.fabric.sdk.hash_algorithm = SM3
org.hyperledger.fabric.sdk.security_level=255

国密商密什么意思

国密算法即国家密码局认定的国产密码算法,即商用密码。
国际算法由美国的安全局发布,是现今最通用的商用密码算法。

美国国家标准局

美国国家安全局

商密-国际商用加密算法

一般说商密是指商用密码。更多是我们更加耳熟能详的的密码学标准。诸如AES、DAS、RSA、ECC椭圆曲线系列等加密算法。

国密-中国国家商用密码算法

国密是中国国家密码局认定和颁发的密码算法标准,SM 是一个系列,常用的包括SM1、SM2、SM3、SM4。

经中央机构编制委员会批准,原国家密码管理委员会办公室更名为国家密码管理局

《商用密码管理条例》

《行业标准公告》2012-3-21

为啥有了商密还要有国密

为什么有了商密还要国密。主要原因可能包括:

1、一部分商密的设计中涉及到的一些具体步骤主要是老美的一些强力部门负责的。里面是不是有个什么漏洞啊、后门啊什么的不清楚。

2、国密是自己人弄的,对于原理和实现细节一清二楚。用起来放心。
目前国密主要是对国内的产品,有些特殊的产品国家会强制使用。

密码学目前主要包括有

  • 对称加密算法。常见的包括DES、3DES、AES、SM1等。
  • 非对加密算法。常见的包括RSA、ECC、SM2等。
  • 消息摘要算法。最常见的就是md5、SHA系列、SM3。

标题1

allala

标题二

第二部分

无序列表:使用星号、加号或是减号作为列表标记

  • Red
  • Green
  • Blue

有序列表:使用数字接着一个英文句点

  1. Red

  2. Green

  3. Blue

    aaa
    bbb

  4. 11

  5. 333

  6. 不勾选

  7. 勾选

  8. 223

  • 不勾选
  • 勾选

强调

在Markdown中,可以使用 * 和 _ 来表示斜体和加粗。

斜体:

1
2
*Coding,让开发更简单*
_Coding,让开发更简单_

Coding,让开发更简单
Coding,让开发更简单

加粗:

1
2
**Coding,让开发更简单**
__Coding,让开发更简单__

Coding,让开发更简单
Coding,让开发更简单

代码

只要把你的代码块包裹在 “` 之间,你就不需要通过无休止的缩进来标记代码块了。 在围栏式代码块中,你可以指定一个可选的语言标识符,然后我们就可以为它启用语法着色了。 举个例子,这样可以为一段 Ruby 代码着色:

1
2
3
require 'redcarpet'
markdown = Redcarpet.new("Hello World!")
puts markdown.to_html

自动链接

方括号显示说明,圆括号内显示网址, Markdown 会自动把它转成链接,例如:

1
[超强大的云开发平台Coding](http://coding.net)

超强大的云开发平台Coding

表格

在 Markdown 中,可以制作表格,例如:

1
2
3
4
First Header | Second Header | Third Header
------------ | ------------- | ------------
Content Cell | Content Cell | Content Cell
Content Cell | Content Cell | Content Cell
First Header Second Header Third Header
Content Cell Content Cell Content Cell
Content Cell Content Cell Content Cell

分割线

在 Markdown 中,可以使用 3 个以上『-』符号制作分割线,例如:

1
2
3
这是分隔线上部分内容
---
这是分隔线下部分内容

效果图如下:

这是分隔线上部分内容

这是分隔线下部分内容

没有了

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.

Quick Start

Create a new post

1
$ hexo new "My New Post"

More info: Writing

Run server

1
$ hexo server

More info: Server

Generate static files

1
$ hexo generate

More info: Generating

初始化

git init .

增加 theme
git submodule add git@github.com:theme-next/hexo-theme-next themes/next

git commit -m “init”

推送到远程仓

git remote add origin git@github.com:wanghongxing/wanghongxing.github.io.git
git push –set-upstream origin src

Deploy to remote sites

1
$ hexo deploy

More info: Deployment