分类 Network 中的文章

Linux安全配置

生成密钥对 [root@host ~]# ssh-keygen <== 建立密钥对 Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): <== 按 Enter Created directory '/root/.ssh'. Enter passphrase (empty for no passphrase): <== 输入密钥锁码,或直接按 Enter 留空 Enter same passphrase again: <== 再输入一遍密钥锁码 Your identification has been saved in /root/.ssh/id_rsa. <== 私钥 Your public key has been saved in /root/.ssh/id_rsa.pub. <== 公钥 The key fingerprint is: 0f:d3:e7:1a:1c:bd:5c:03:f1:19:f1:22:df:9b:cc:08 root@host 目标主机安装密钥 [root@host ~]# cat id_rsa.pub >> authorized_keys [root@host ~]# chmod 600 authorized_keys [root@host ~]# chmod 700 ~/.ssh sshd常用安全设置 [root@host ~]# vi /etc/ssh/sshd_config Port 2222 # 修改端……

阅读全文

网络命令积累

route 命令 用于多网卡时指定路由。 1#例子1:要显示IP路由表的完整内容: 2route print 3#例子2:要显示IP路由表中以10.开始的路由: 4route print 10.* 5#例子3:要添加默认网关地址为192.168.12.1的默认路由: 6route add 0.0.0.0 mask 0.0.0.0 192.168.12.1 7#例子4:要添加目标为10.41.0.0,子网掩码为255.255.0……

阅读全文