Linux安装后基础配置--网络--ssh--基本软件

news2024/9/23 19:30:19

安装教程比较多就不写了。

网络配置

设置虚拟网络

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

修改网络配置文件

vi /etc/sysconfig/network-scripts/ifcfg-ens33

将ONBOOT由no改为yes:
在这里插入图片描述

修改为静态网络

/etc/sysconfig/network-scripts/ifcfg-eth33

BOOTPROTO=static
IPADDR=192.168.1.129
GATEWAY=192.168.1.2
DNS1=8.8.8.8
DNS2=114.114.114.114

添加dns服务器

在此要强调一点的是,直接修改/etc/resolv.conf这个文件是没用的,网络服务重启以后会根据/etc/sysconfig /network-scripts/ifcfg-eth33来重载配置
我们上面加了就不用改了

vi /etc/resolv.conf

添加首选DNS服务器和备选DNS服务器。

nameserver 8.8.8.8
nameserver 114.114.114.114

重启网络服务

service network restart

关闭防火墙

虚拟机放心关掉

#暂时关闭防火墙
systemctl stop firewalld
#永久关闭防火墙
systemctl disable firewalld

配置镜像源

备份yum源(可选)

cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

修改

中科大

sed -e 's|^mirrorlist=|#mirrorlist=|g' \
         -e 's|^#baseurl=http://mirror.centos.org/centos|baseurl=https://mirrors.ustc.edu.cn/centos|g' \
         -i.bak \
         /etc/yum.repos.d/CentOS-Base.repo

阿里云

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

清理缓存

yum makecache 

软件安装

Vim

yum -y install vim

wget

yum -y install wget

安装net-tools

	yum search net-tools#先查找在安装
  yum install  -y net-tools.x86_64

更新系统

  yum update -y

ssh

烦死了,改了一个上午,好多教程都没啥用。

可能出现的问题

  1. channel is not opened.
  2. 连接半天,密码没错但是出现要输入密码

解决

首先看ssh是否安装,这个一般都还是有的。

yum list installed | ssh

在这里插入图片描述

主要看配置.

PermitRootLogin改为yes
PasswordAuthentication改为yes
UseDNS改为 no
UsePAM 改为yes

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

重启ssh

systemctl restart sshd.service

配置文件

/etc/ssh/sshd_config

     1  #       $OpenBSD: sshd_config,v 1.100 2016/08/15 12:32:04 naddy Exp $
     2  
     3  # This is the sshd server system-wide configuration file.  See
     4  # sshd_config(5) for more information.
     5  
     6  # This sshd was compiled with PATH=/usr/local/bin:/usr/bin
     7  
     8  # The strategy used for options in the default sshd_config shipped with
     9  # OpenSSH is to specify options with their default value where
    10  # possible, but leave them commented.  Uncommented options override the
    11  # default value.
    12  
    13  # If you want to change the port on a SELinux system, you have to tell
    14  # SELinux about this change.
    15  # semanage port -a -t ssh_port_t -p tcp #PORTNUMBER
    16  #
    17  #Port 22
    18  #AddressFamily any
    19  #ListenAddress 0.0.0.0
    20  #ListenAddress ::
    21  
    22  HostKey /etc/ssh/ssh_host_rsa_key
    23  #HostKey /etc/ssh/ssh_host_dsa_key
    24  HostKey /etc/ssh/ssh_host_ecdsa_key
    25  HostKey /etc/ssh/ssh_host_ed25519_key
    26  
    27  # Ciphers and keying
    28  #RekeyLimit default none
    29  
    30  # Logging
    31  #SyslogFacility AUTH
    32  SyslogFacility AUTHPRIV
    33  #LogLevel INFO
    34  
    35  # Authentication:
    36  
    37  #LoginGraceTime 2m
    38  PermitRootLogin yes
    39  #StrictModes yes
    40  #MaxAuthTries 6
    41  #MaxSessions 20
    42  
    43  #PubkeyAuthentication yes
    44  
    45  # The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2
    46  # but this is overridden so installations will only check .ssh/authorized_keys
    47  AuthorizedKeysFile      .ssh/authorized_keys
    48  
    49  #AuthorizedPrincipalsFile none
    50  
    51  #AuthorizedKeysCommand none
    52  #AuthorizedKeysCommandUser nobody
    53  
    54  # For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
    55  #HostbasedAuthentication no
    56  # Change to yes if you don't trust ~/.ssh/known_hosts for
    57  # HostbasedAuthentication
    58  #IgnoreUserKnownHosts no
    59  # Don't read the user's ~/.rhosts and ~/.shosts files
    60  #IgnoreRhosts yes
    61  
    62  # To disable tunneled clear text passwords, change to no here!
    63  #PasswordAuthentication yes
    64  #PermitEmptyPasswords no
    65  PasswordAuthentication yes
    66  
    67  # Change to no to disable s/key passwords
    68  #ChallengeResponseAuthentication yes
    69  ChallengeResponseAuthentication no
    70  
    71  # Kerberos options
    72  #KerberosAuthentication no
    73  #KerberosOrLocalPasswd yes
    74  #KerberosTicketCleanup yes
    75  #KerberosGetAFSToken no
    76  #KerberosUseKuserok yes
    77  
    78  # GSSAPI options
    79  GSSAPIAuthentication yes
    80  GSSAPICleanupCredentials no
    81  #GSSAPIStrictAcceptorCheck yes
    82  #GSSAPIKeyExchange no
    83  #GSSAPIEnablek5users no
    84  
    85  # Set this to 'yes' to enable PAM authentication, account processing,
    86  # and session processing. If this is enabled, PAM authentication will
    87  # be allowed through the ChallengeResponseAuthentication and
    88  # PasswordAuthentication.  Depending on your PAM configuration,
    89  # PAM authentication via ChallengeResponseAuthentication may bypass
    90  # the setting of "PermitRootLogin without-password".
    91  # If you just want the PAM account and session checks to run without
    92  # PAM authentication, then enable this but set PasswordAuthentication
    93  # and ChallengeResponseAuthentication to 'no'.
    94  # WARNING: 'UsePAM no' is not supported in Red Hat Enterprise Linux and may cause several
    95  # problems.
    96  UsePAM yes
    97  
    98  #AllowAgentForwarding yes
    99  #AllowTcpForwarding yes
   100  #GatewayPorts no
   101  X11Forwarding yes
   102  #X11DisplayOffset 10
   103  #X11UseLocalhost yes
   104  #PermitTTY yes
   105  #PrintMotd yes
   106  #PrintLastLog yes
   107  #TCPKeepAlive yes
   108  #UseLogin no
   109  #UsePrivilegeSeparation sandbox
   110  #PermitUserEnvironment no
   111  #Compression delayed
   112  #ClientAliveInterval 0
   113  #ClientAliveCountMax 3
   114  #ShowPatchLevel no
   115  UseDNS no
   116  #PidFile /var/run/sshd.pid
   117  #MaxStartups 10:30:100
   118  #PermitTunnel no
   119  #ChrootDirectory none
   120  #VersionAddendum none
   121  
   122  # no default banner path
   123  #Banner none
   124  
   125  # Accept locale-related environment variables
   126  AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
   127  AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
   128  AcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGE
   129  AcceptEnv XMODIFIERS
   130  
   131  # override default of no subsystems
   132  Subsystem       sftp    /usr/libexec/openssh/sftp-server
   133  
   134  # Example of overriding settings on a per-user basis
   135  #Match User anoncvs
   136  #       X11Forwarding no
   137  #       AllowTcpForwarding no
   138  #       PermitTTY no
   139  #       ForceCommand cvs server

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/400553.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

《c++ primer笔记》第九章 顺序容器

前言 知识点很多,这里只记录遗忘的。从这章开始会对前面章节的内容进行一个扩充,如果以前的忘了读起来会有点吃力。总的来说,本章节难度不大。 文章目录一、概述二、容器库概览2.1容器定义和初始化2.2赋值三、顺序容器操作3.1添加元素3.2删除…

Vue3通透教程【六】setup语法糖、computed函数、watch函数

文章目录🌟 写在前面🌟 setup 语法糖🌟 computed函数🌟 watch 函数🌟 写在最后🌟 写在前面 专栏介绍: 凉哥作为 Vue 的忠实 粉丝输出过大量的 Vue 文章,应粉丝要求开始更新 Vue3 的…

体验Linux 块设备驱动实验(模拟块)

目录 一、块设备 二、块设备驱动框架 1、块设备的注册和注销 2、gendisk 结构体 3、block_device_operations 结构体 4、块设备 I/O 请求过程 ①、请求队列 request_queue ②、bio 结构 三、编写驱动之请求队列 1、修改makefile 2、基本的驱动框架​编辑 3、添加头文…

XWiki Annotation Displayer 存在任意代码执行漏洞(CVE-2023-26475)

漏洞描述 XWiki 是一个开源的企业级 Wiki 平台,Annotation Displayer 是 XWiki 中的一个插件,用于在 XWiki 页面上显示注释和其他相关内容。 该项目受影响版本存在任意代码执行漏洞,由于Annotation Displayer 对 Groovy 宏的使用没有限制&a…

机载SAR文献调研(CSDN_0027_20230219)

文献(电子所)文献名[1]:詹学丽, et al., 一种用于合成孔径雷达的数字去斜方法. 雷达学报, 2015. 4(04): p. 474-480文章摘要该文提出了一种用于合成孔径雷达(SAR)的数字去斜方法,适用于发射信号脉冲宽度能够…

女神节 | PHP和Java算什么,女工程师才是最美最好的语言!

世界上第一个程序员是女性 第一个发现Bug的也是女性 在智领云有一群追求快乐和独立的女性工程师 她们多有魅力? 工位上她们专注于数据与代码 平日里郊游、瑜伽、插花、科学养娃一件不落 不仅用0和1编织数字世界 也在用心装点自己的生活 今天是国际劳动妇女节…

Linux 虚拟机安装及与windows远程登录

说明: 本次学习是在windows上安装虚拟机进行的。所以需要先安装VMware WorkStation,这玩意需要秘钥。所以你懂的,资源网上很多 Linux镜像文件下载地址CentOS Linux​​​​​​ 一、 打开VMware,点击创建新的虚拟机 二、选择下载…

【FATE联邦学习】自定义数据集自定义神经网络模型下的横向纵向训练

前言 代码大部分来自 https://fate.readthedocs.io/en/latest/tutorial/pipeline/nn_tutorial/Hetero-NN-Customize-Dataset/#example-implement-a-simple-image-datasethttps://fate.readthedocs.io/en/latest/tutorial/pipeline/nn_tutorial/Homo-NN-Customize-your-Datase…

[沧海月明珠有泪]两数求和

自己写的像屎山一样的代码,实在难以入眼。学习下人家优秀的代码思想粗看这个代码,用的是递归的思想前面三行的意思:初始化两个链表。第四行:把两个链表的值相加赋给sum第五行:判断是否大于9第六行:如果l1的…

map 、multimap

目录 1.基本概念,键值对 2.map的构造和赋值 3.map的大小和交换,size,empty,swap 4.map的插入和删除,insert(make_pair),clear,erase,[]利用key访问vale 5.map的查找和统计,find,count 6.map容器的排序,自定义排序,仿函数 6.…

5MW风电永磁直驱发电机-1200V直流并网MATLAB仿真模型

MATLAB2016b运行。主体模型:风机传动模块、PMSG模块、蓄电池模块、超级电容模块、无穷大电源。蓄电池控制、风机控制、逆变器控制。风机输出功率:直流母线电压:逆变器输出电压:逆变器输出电流:混合储能荷电状态&#x…

2023年金三银四跳槽季,阿里巴巴 Java10W 字面经,首次公布

Java 面试 “金三银四”这个字眼对于程序员应该是再熟悉不过的了,每年的金三银四都会有很多程序员找工作、跳槽等一系列的安排。说实话,面试中 7 分靠能力,3 分靠技能;在刚开始的时候介绍项目都是技能中的重中之重,它…

超图iServer扩展开发记录Restlet 1

在“REST 服务发布机制简述”中,讲述了 REST 服务发布的过程,资源的信息保存在资源配置文件里,并通过 REST 应用上下文传递给 REST 应用对象,从而在 HTTP 请求到达 REST 应用对象的时候,能够找到合适的资源实现来处理。…

Jwt简介

目录前言What is JSON Web Token?When should you use JSON Web Tokens?What is the JSON Web Token structure?HeaderPayloadSignaturePutting all togetherHow do JSON Web Tokens work?Why should we use JSON Web Tokens?前言 技术文档这种东西,我一直认为…

数枝营销与纷享销客达成战略合作,共同推动B2B企业营与销一体化

近日,营销咨询与数字化服务商数枝营销同国内知名SaaS CRM厂商纷享销客举行了战略合作签约仪式,双方就促进B2B企业的“营与销协同增长”将展开全面合作。纷享销客创始人兼CEO罗旭与数枝营销创始人黄海钧 另据工商信息显示,数枝营销&#xff08…

webshell管理工具-菜刀的管理操作

什么是webshell Webshell是一种运行在Web服务器上的脚本程序,通常由黑客使用来绕过服务器安全措施和获取对受攻击服务器的控制权。Webshell通常是通过利用Web应用程序中的漏洞或者弱密码等安全问题而被植入到服务器上的。 一旦Webshell被植入到服务器上&#xff0…

基于应用理解的协议栈优化

作者:余兵 移动互联网时代,不同的应用追求的产品体验差异性很大。 应用商店和图片等下载类型业务追求速度、越快越好,短视频关注起播、拖拽响应速度和观看过程卡不卡,直播追求画质清晰、高码率和直播过程流畅;而游戏则…

苹果iPhone屏下Touch ID技术专利获批,苹果Find My技术大火

根据美国商标和专利局(USPTO)公示的最新清单,苹果近日获得了屏下 Touch ID 的新技术专利。专利中重点提及了“短波红外线”技术,相关元件位于屏幕下方或者集成到屏幕内。 该专利主要介绍了应用于屏幕 Touch ID 的光学成像系统&…

自动化工具selenium(一)

一)什么是自动化?为什么要做自动化? 自动化测试可以代替一部分手工测试,不能够完全代替手工测试 1)自动化测试相比于手工测试来说人力的投入和时间的投入是非常非常少的,自动化测试能够提高测试效率 2)在回归测试里面,…

被隐藏的过程——预处理

文章目录0. 前言1. 程序的翻译环境和执行环境2. 被隐藏的过程2.1 翻译环境2.2 编译3.2.1 预编译3.2.2 编译2.2.3 汇编2.3 链接2.4 运行环境3. 预处理3.1 预定义符号3.2 #define3.2.1 #define定义标识符3.2.2 #define定义宏3.2.3 #define替换规则3.2.4 #和##3.2.5 带副作用的宏参…