Keep

Sever

2018/01/07 06:02

ssh

重启

/etc/init.d/sshd restart

配置

# ssh server config path
/etc/ssh/sshd_config
# server
~/.ssh/
~/.ssh/authorized_keys # 里面直接放 .pub 字符串
# client
# ~/.ssh/config
Host paper
	HostName 47.94.22.19
	Port 22
	User root
	IdentitiesOnly yes
	IdentityFile ~/.ssh/paper

# Host ...
# 921.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDQkoMY6cPVCwsH25WCWSx1SpAcfy/VJMa7ibpKG6qxSyPx6CT1k038fWYIIRNrgj5tcvKAbNQrjaYt78Eyu4U+d7dPKpEjTWJPusqJK2mF4z+V6bfmSXdnNZFTCM0lye3tlnlEN+dCap8EcqFeQhoBz87vrMnDUjA4alKso01JHc2pYIWSLNzwEyPV9FnRXY7dfBlim6OOGXWOO7aBg0QaJ0PSZfX871YyGYHR+nhaX8vQTo0IVMlyYVPlfd21MUJ/V0G+AIoaKr9n1RLagLvnFPCvoL0jlqLLmXL7aqs9luzD3DpK8EXxSIC+9E0BMUVKHVqZW2iWjZiAwCZAjBl9 redky@redky.local

# paper.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCrdlr548Z/oOeRXm030PIY6/kNYpCc8I7Dhy4L6kQwm0djTqOm8EoBO0R5KIWqzz8S2g2q3fXeeiISM5grTtdccyvF3Ii7WJM38qop1xyehe8SgyqgfGI3YsSAC+lWsFA/BxhwF/06+K4Sqc4kEpC+Cnrwjctb4qrUwJMxaO/W2j37IWYqUzMZEFqP8ajPXukrqdJOZz56OKwxDFcP51QpFPy6U0269zqNmGA8LAczlQe48c70EvhbTj1P73tXbOnVQvXsVJVCMDv59xwrfciNeqwZAoGX5GTUi4MDyOCkq4ybL8ZD+FYVd5+YWzcsoIKyF9ou+2gyNupCFe5qhrPf zhanhongtao@zhanhongtao

rsync

config

/etc/rsyncd/rsyncd.conf

rsync

rsync -avz . foo:/path

rsync -tvzrlp . user@server:/path

# -v 显示更多信息
# -z 压缩后传输
# -r 递归处理目录
# -l 处理软连接
# -p 保留权限
# -t 同步 modify time. 在同步时会对比文件, 一样(时间戳/文件大小)就不再同步
# -go 对应 group/owner

rsync -a . user@server:/path

# -a 相当于 -rlptgoD. archive option

Redky,生活在北京(北漂),程序员,宅,喜欢动漫(海贼王)。"年轻骑士骑马出城,不曾见过绝望堡下森森骸骨,就以为自己可以快意屠龙拯救公主。"