linux---网络相关配置,ssh服务,bash命令及优先级,元字符
-
二:临时配置网络(ip,网关,dns)+永久配置
临时配置:
[root@nfs-server ~]# ens32: inet inet6 ether RX RX TX TX lo: inet inet6 loop RX RX TX TX [root@nfs-server ~]# [root@nfs-server ~]# route Kernel IP routing table Destination 192.168.152.0 [root@nfs-server ~]# route [root@nfs-server ~]# route Kernel IP routing table Destination 0.0.0.0 192.168.152.0 [root@nfs-server ~]# cat # Generated by search localdomain nameserver 192.168.152.2 nameserver 202.106.0.20 |
永久配置:
[root@nfs-server ~]# cat TYPE=Ethernet BOOTPROTO=dhcp IPADDR=192.168.152.134 NETMASK=255.255.255.0 GATEWAY=192.168.152.2 DNS1=192.168.152.2 DNS2=202.106.0.20 DEFROUTE=yes PEERDNS=yes PEERROUTES=yes IPV4_FAILURE_FATAL=no IPV6INIT=yes IPV6_AUTOCONF=yes IPV6_DEFROUTE=yes IPV6_PEERDNS=yes IPV6_PEERROUTES=yes IPV6_FAILURE_FATAL=no IPV6_ADDR_GEN_MODE=stable-privacy NAME=ens32 UUID=9eff3909-2614-4df9-80c9-a6a7d9f1be28 DEVICE=ens32 ONBOOT=yes [root@nfs-server ~]# |
三:为集群内的机器设定主机名,利用/etc/hosts文件来解析自己的集群中所有的主机名,相应的,集群的配置应该改成使用主机名的方式
修改主机名:
hostname python_web1
cat /etc/hostname
python_web1
修改host文件:
[root@python_web1 ~]# cat /etc/hosts
192.168.2.3 python_web1
[root@python_web1 ~]# ping python_web1
四:ssh登录,scp上传、下载,ssh秘钥登录,修改ssh
server端的端口为8888然后进行登录和scp测试
SSH登录:
[root@proxy-nfs ~]# scp The authenticity of ECDSA key Are you sure you want Warning: Permanently root@web01's password: hosts [root@proxy-nfs ~]# scp root@web01's password: hosts [root@proxy-nfs ~]# ls -l -rw-r--r-- 1 root root 274 |
秘钥登录:
[root@proxy-nfs ~]# Generating public/private rsa Enter Enter passphrase Enter same passphrase Your identification has Your public key The key 29:90:f7:3a:24:0a:e2:f9:22:ec:f4:07:75:7c:10:6b The key's randomart +--[ RSA 2048]----+ | | . | o | |o o + |o..o o |.+. . |ooo . |o..o. +-----------------+ [root@proxy-nfs ~]# /usr/bin/ssh-copy-id: INFO: /usr/bin/ssh-copy-id: INFO: root@web01's password: Number of key(s) added: 1 Now try logging into the and check to make sure that [root@proxy-nfs ~]# [root@proxy-nfs ~]# The authenticity of ECDSA key Are you sure you want to continue connecting /usr/bin/ssh-copy-id: INFO: /usr/bin/ssh-copy-id: INFO: root@web02's password: Number of key(s) added: 1 Now try logging into the and check to make sure that [root@proxy-nfs ~]# The authenticity of host 'web03 ECDSA key Are you sure you want /usr/bin/ssh-copy-id: INFO: /usr/bin/ssh-copy-id: INFO: root@web03's password: Number of key(s) added: 1 Now try logging into the and check to make sure that # 修改SSH端口 [root@proxy-nfs ~]# ssh Last login: Tue Mar 21 [root@web01 ~]# sed -i [root@web01 ~]# grep 8888 Port 8888 [root@web01 ~]# exit logout Connection to web01 closed. [root@proxy-nfs ~]# ssh Last login: Tue Mar 21 [root@web02 ~]# sed -i [root@web02 ~]# grep 8888 Port 8888 [root@web02 ~]# exit logout Connection to web02 closed. [root@proxy-nfs ~]# ssh Last login: Tue Mar 21 [root@web03 ~]# sed -i [root@web03 ~]# grep 8888 Port 8888 [root@web03 ~]# exit logout Connection to web03 closed. [root@proxy-nfs ~]# # SCP 远程拷贝文件 [root@proxy-nfs ~]# touch [root@proxy-nfs ~]# scp oldgirl.txt [root@proxy-nfs ~]# scp passwd |
五:整理bash命令类型,验证寻找一个命令的优先级
# 以ls命令为例
命令分为:
==> alias
==> Compound Commands
==> function
==> build_in
==> hash
==> $PATH
==> error: command not found
获取一个命令会按照上述优先级取寻找,先找同名的alias命令,再找compound命令。。。
最新文章
- JDBC介绍
- Swift 基本常量和变量,基本数据类型
- 移动端接口:java写get方式访问数据(springmvc+spring。。。)
- Android Toast效果设置
- Windows Phone 8 Sync
- regardless of how many processors are devoted to a parallelized execution of this program
- CUBRID学习笔记 30 复制表结构 cubrid教程
- Machine Learning - 第4周(Neural Networks: Representation)
- javaweb之Cookie篇
- crm plugin 未能加载文件或程序集“xxxx,”或它的某一个依赖项。系统找不到指定的文件。
- Sql CLR
- 解决Ubuntu14.04下Clementine音乐播放器不能播放wma文件的问题
- Oracle 中的Pivoting Insert用法
- smarty的学习计划(2)
- Jquery使用mouseenter和mouseleave实现鼠标经过弹出层且可以点击
- React 和 Redux 结合 1
- 「JLOI2015」城池攻占 解题报告
- Hibernate-使用事务
- (转)C# .net微信开发,开发认证,关注触发消息,自动应答,事件响应,自定义菜单
- 天梯赛 L2-014 列车调度 (模拟)