加密技术概览

风险行为

窃听

%E5%8A%A0%E5%AF%86%E6%8A%80%E6%9C%AF%E6%A6%82%E8%BF%B0%2048aff8cbada34d7fa1b9a42bd48f413e/Untitled.png

篡改

%E5%8A%A0%E5%AF%86%E6%8A%80%E6%9C%AF%E6%A6%82%E8%BF%B0%2048aff8cbada34d7fa1b9a42bd48f413e/Untitled%201.png

ssh登陆远程主机

###方法一:
将.ssh/id_rsa.pub内容加入到远程主机.ssh/authorized_keys

1
2
3
4
5
youthy@youthy:~$ scp .ssh/id_rsa.pub user@remote_host:~
输入密码
ssh user@remote_host
输入密码
[root@li1166-59 ~] cat id_rsa.pub >> .ssh/authorized_keys

注意文件是authorized_keys 不是authorize_keys

###方法二:

1
ssh-copy-id -i .ssh/id_rsa.pub user@remote_host

将id_rsa.pub自动添加到authorized_keys尾部.

文件名必须是id_rsa.pub

###attention
.ssh文件夹权限必须是700

.ssh/authorized_keys必须是600

无效时清理下主机.ssh/known_hosts

ranch笔记

任何使用ranch的程序第一步需要启动ranch_app

start ranch application

入口
ranch_app:

1
2
3
start(_, _) ->
_ = consider_profiling(), %% 是否启动eprof
ranch_sup:start_link().

gitnote

git

##startup

配置文件

  1. /etc/.gitconfig 最顶级
  2. /home/$USERNAME/.gitconfig 用户设定
  3. project/.gitconfig 当前项目
    下面会把上面的设定覆盖.

git config --global user.name "XXX"
修改/home/username config
git config (--local) user.name "YY"
修改当前项目下的gitconfig
git config --system user.name "ZZZ"
系统通用配置文件

git config --global|system|local --get user.name -> XXX
git config user.name 简写