1. 配置IP地址 #

1.1 ifconfig临时配置IP #

3. 查看网络环境 #

3.1 查询网络状态 #

选项 含义
-t 列出TCP协议端口
-u 列出UDP协议端口
-n 不使用域名与服务名,而使用IP地址和端口号
-l 仅列出在监听状态网络服务
-a 列出所有的网络连接
netstat -tlun
netstat -an | more
netstat -unt | grep  ESTABLISHED

4. 网络测试命令 #

4.1 ping #

ping www.baidu.com -c 3

4.2 wget #

wget http://www.baidu.com

5.远程登录 #

5.1 SSH协议原理 #

5.1.1 对称加密算法 #

5.1.2 SSH 安全外壳协议 #

[root@192-171-207-101-static ~]# ssh root@192.171.207.101
The authenticity of host '192.171.207.101 (192.171.207.101)' can't be established.
RSA key fingerprint is a4:97:52:eb:0a:0b:35:a0:98:7d:4f:c8:3b:dc:f9:0a.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.171.207.101' (RSA) to the list of known hosts.

/root/.ssh/known_hosts

192.171.207.101 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAomDpQxV3RmjJyKkf7elMTInbdm+/ZLnFpfbAryi5PSb2ewfYbwRaBcVl1lBta6yjFuz0J12p9qy90DBhadvoBsfwTB8lQhmlT8B2eCcHr0bfLa1IdKMcjImxRJiD4v0emCGFquHnHIr41vs8uxQ2Ek28mH/1JC0e/+VPEvylBB4+Kk2789ACdAlmhGTtlu7zgeUoLaWQSl1/6g7zfSLIz+/U8qGiRSPaGT+M40oqx/PZdoGOMTRhHgNIR5qgvcNaJXhlZGYT42fLFSmtzUHJ030hP7JGZ99oXS20/mnc8qvonC9itp0+K/nCj5g6uR/gPFb5B0NmTZCM2/gcLkHumw==

5.1.3 scp #

参数 含义
-r 递归复制整个目录
-v 详细方式显示输出
5.1.3.1 从本地服务器复制到远程服务器 #
scp local_file remote_username@remote_ip:remote_folder  
scp -r local_folder remote_username@remote_ip:remote_folder  
5.1.3.2 从远程服务器复制到本地服务器 #
scp  remote_username@remote_ip:remote_folder  local_file
scp -r  remote_username@remote_ip:remote_folder local_folder