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命令。。。
linux---网络相关配置,ssh服务,bash命令及优先级,元字符的更多相关文章
- Linux网络相关配置
一.修改网卡相关配置 Linux网络参数是在/etc/sysconfig/network-scripts/ifcfg-eth0中设置,其中ifcfg-eth0表示是第一个网卡,如果还有另外一块网卡,则 ...
- Linux网络属性配置命令和管理详解
一.Linux网络属性配置 1.Linux主机接入到网络方式 IP/NETMASK:实现本地网络通信 路由(网关):可以进行跨网络通信 DNS服务器地址:基于主机名的通信,Linux可以有三个DNS地 ...
- Linux下安装并配置SSH服务
一.使用命令检测Linux系统上是否已经安装了SSH服务:(命令:rpm -qa |grep ssh) 二.如果没有安装SSH软件包,可以通过yum 或rpm安装包进行安装(命令:yum instal ...
- Linux 网络相关命令 Cheat Sheet
以下漫画形式呈现的常用 Linux 网络相关命令速查表来自 twitter -
- 10.11 Linux网络相关 10.12 firewalld和netfilter 10.13 netfilter5表5链介绍 10.14 iptables语法
Linux网络相关 ifocnfig 查看网卡ip(yum install net-tools) ip add 查看网卡 ip add = ifocnfig ifconfig 不显示down掉的网卡, ...
- Linux网络基础配置
这是看itercast视频的笔记 Linux网络基础配置 以太网连接 在Linux中,以太网接口被命令为:eth0, eth1等, 0,1代表网卡编号 通过lspci命令可以查看网上硬件信息(如果是u ...
- Linux入门-6 Linux网络基本配置
1. 网络基础知识 网络编址 IP编址 子网掩码 同一网络主机之间通信--MAC地址 不同网络之间的通信 路由 域名 DNS 基本网络参数 2. Linux网络基础配置 以太网连接 配置网络信息 网络 ...
- Linux网络相关、firewalld和netfilter、netfilter5表5链介绍、iptables语法 使用介绍
第7周第3次课(5月9日) 课程内容: 10.11 Linux网络相关10.12 firewalld和netfilter10.13 netfilter5表5链介绍10.14 iptables语法 扩展 ...
- CentOS7系列--2.2CentOS7中配置SSH服务
CentOS7配置SSH服务 1. SSH配置 1.1. 使用SSH服务更加安全 [root@centos7 ~]# vi /etc/ssh/sshd_config 设置如下 PermitRootLo ...
- Linux centos7 Linux网络相关、firewalld和netfilter、netfilter5表5链介绍、iptables语法
一. Linux网络相关 yum install net-tools ifconfig查看网卡ip ifup ens33开启网卡 ifdown ens33关闭网卡 设定虚拟网卡ens33:0 mii- ...
随机推荐
- SQL Server语句创建数据库和表——并设置主外键关系
简单的创建数据库的 SQL 语句: use master go if exists(select * from sysdatabases where name='Test') begin select ...
- smarty模板(转载)
一.smarty的程序设计部分: 在smarty的模板设计部分我简单的把smarty在模板中的一些常用设置做了简单的介绍,这一节主要来介绍一下如何在smarty中开始我们程序设计.下载Smarty文件 ...
- [Windows Powershell]-学习笔记(5)
Powershell自动化变量 Powershell 自动化变量 是那些一旦打开Powershell就会自动加载的变量,或者说是运行是变量. 这些变量一般存放的内容包括 用户信息:例如用户的根目录$h ...
- bootstrap常用知识点总结
api地址:https://v3.bootcss.com/css/#forms 栅格参数: bootstrap 其实 是把 网页等 分为 了 12分,bootstrap把 根据屏 幕 大小 把屏 幕分 ...
- Connecting to a Remote Serial Port over TCP/IP
https://www.acmesystems.it/socat This article illustrates how to realize a lan to serial gateway Rem ...
- fzu1901Period II
地址:http://acm.fzu.edu.cn/problem.php?pid=1901 题目: Problem 1901 Period II Accept: 442 Submit: 1099 ...
- Salesforce中通过SOAP API和Metadata API开发java的web server服务
1.下载Salesforce平台中WSDL文件 在Salesforce中创建了自己需要用到的对象后,我们想要在别的应用中读写纪录到对象中,首先需要的是自己Salesforce平台的权限通过.登陆自己的 ...
- win10+eclipse+hadoop2.7.2+maven+local模式直接通过Run as Java Application运行wordcount
一.准备工作 (1)Hadoop2.7.2 在linux部署完毕,成功启动dfs和yarn,通过jps查看,进程都存在 (2)安装maven 二.最终效果 在windows系统中,直接通过Run as ...
- centos配置jdk的环境变量
1.首先呢,centos下的JDK环境配置分两种情况,一直是root用户级别的jdk配置,另一种是其他用户组级别的配置.这里讲解的是root用户级别的配置. 我们已经下载解压好了jdk的目录.如下 2 ...
- uboot下ext4ls的用法
列出sd卡的第一个分区里/bin目录下的内容,示例如下: ext4ls mmc 0:1 /bin