惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

有赞技术团队
有赞技术团队
G
Google Developers Blog
T
Tailwind CSS Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
人人都是产品经理
人人都是产品经理
J
Java Code Geeks
P
Proofpoint News Feed
V
Visual Studio Blog
爱范儿
爱范儿
The Cloudflare Blog
博客园 - 叶小钗
V
V2EX
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
M
MIT News - Artificial intelligence
Microsoft Security Blog
Microsoft Security Blog
博客园 - 聂微东
H
Help Net Security
B
Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 【当耐特】
量子位
宝玉的分享
宝玉的分享
WordPress大学
WordPress大学
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知

夜行人

回家路上 第一期的直播演示项目 震动检测器 正能量 在线参观CodeLab Neverland 发布 CodeLab Adapter 3.3.1 DynamicTable 之 纸糊方向盘 CodeLab DynamicTable: 一个可实施的技术方案 CodeLab Insight 发布 Alpha 版 情人节 Home Assistant 周报 && IoT 周报 (02) Joplin: 关注隐私的 Evernote 开源替代软件 浏览器的未来与 Web 传感器 Home Assistant 周报 && IoT 周报 (01) 百宝箱(01) 论自由 介绍 WebThings Home Assistant 周报 && iot 周报 (00) 百宝箱(00) 毛姆读书心得 传世之作 周末徒步 CodeLab Adapter ❤️ Jupyter/Python 航班 躲雨 夏令营途中 [译]思想--作为一种技术 The future of coding 美国之行 三门问题的程序模拟
ssh相关
2014-07-10 · via 夜行人

文章目录

##安装(ubuntu)

sudo apt-get install openssh-server

##配置 ###允许密码配置 vim /etc/ssh/sshd_config使:

PasswordAuthentication yes

###安全相关 修改登录端口

vim /etc/ssh/sshd_config使:

Port [port]

端口号选择大一些,被随机扫描的可能性更小

###使用密钥登录并禁止口令登录实践 这是最相对安全的登录管理方式

 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
:::text
#以下用户都是root(sudo)

#生成SSH密钥对,一路回车就行
ssh-keygen -t rsa

#复制公钥到无密码登录的服务器上,22端口改变可以使用下面的命令
#ssh-copy-id -i ~/.ssh/id_rsa.pub -p 10022 user@server
ssh-copy-id -i ~/.ssh/id_rsa.pub root@192.168.15.241
#登录时需要使用相应账号登录

#也可以登录被控机器后 cd .ssh,wget https://github.com/wwj718.keys 之后chmod 600 authorized_keys
#authorized_keys 文件必须是600权限或者644
#.ssh目录必须是700权限
#/home/ubuntu 目录必须是755权限

#修改SSH配置文件
#编辑sshd_config文件
vi /etc/ssh/sshd_config

#禁用密码验证
PasswordAuthentication no
#启用密钥验证
RSAAuthentication yes
PubkeyAuthentication yes
#指定公钥数据库文件
AuthorsizedKeysFile .ssh/authorized_keys

#重启SSH服务前建议多保留一个会话以防不测

#手动增加管理用户
echo 'ssh-rsa XXXX' >>/root/.ssh/authorized_keys

# 复查
cat /root/.ssh/authorized_keys

##重启

1
2
3
4
5
6
7
:::text
#RHEL/CentOS系统
service sshd restart
#ubuntu系统
service ssh restart
#debian系统
/etc/init.d/ssh restart

#补遗 ###X11 Forwarding 通过使用ssh -X user@host,可以做到开启远端GUI应用,就像在本地开启一样,max下需要安装Quartz


2016-05-04修改

  • 强烈建议使用 ssh-copy-id来移动你的公共密钥
  • 使用~/.ssh/config, 你可以在~/.ssh/config里面指定相当数量的配置选项,强烈建议看网上的文档或者 ssh_config 手册页
1
2
3
4
5
6
:::text
# contents of $HOME/.ssh/config
Host dev
    HostName dev.example.com
    Port 22000
    User fooey

ssh startx

使用ssh进入图形界面

How do I access my remote Ubuntu server via X-windows from my Mac

参考

文章作者 种瓜

上次更新 2014-07-10