DAY01 Amin Linux Learning

Source: Internet
Author: User

Amin linux-Installation Login CentOS7

1.1 Beginning of study

目的:为了更好的发展空间,学习一个好点的技术,稳定的收入,能够更好的照顾家人。爱好中Linux比较好职位:运维工程师,再学习自动化运维城市:深圳或其他一线城市学完时间:2018-06月份之前跳槽时间:学完之后

1.2 conventions

学习的方法预习和复习当日事当日毕记笔记利用好资源像学习好的同学借鉴方法,到看看别的同学遇到过的问题

1.3 Understanding Linux

centos7.3vm10putty+xshell印象笔记51CTO博客keepass    keepass.info百度网盘各软件版本会变动r.aminglinux.com课程用到的代码及命令centos7.aminglinux.comLinux是一个操作系统,与Windows不同的一个操作系统,操作系统包括Linux、Windows、Unix,Linux和Unix有很多相同之处,Windows是主流桌面系统,Linux是主流服务器系统。Linux是Linus Torvalds在1991年大学期间,参考Minix开发出来的,刚开始是一个测试版的小内核GNU  gpl  自由软件组织,开源开放Linux发行版Debian 1993  --- ubuntu 2004Slackware 1993  SUSE 1994RedHat 1994  Centos2003RedHat 中国版 RedFlag 1999RedHat 社区版 Fedora 2002             RHEL 商业收费版CentOS 是 RedHat商业版去除收费软件代码后,重新编译而成,CentOS和RHEL 99%相同

1.4 Creating a virtual machine

打开VMware软件,创新新的虚拟机,典型稍后安装操作系统Linuxcentos764虚拟机名称保存位置,建议电脑一个大的分区里磁盘分区容量,30G,将虚拟磁盘拆分成多个文件自定义设置,硬件,内存至少1G,处理器1核即可,网卡建议选择NAT模式(VMware是路由器的功能,更换网络环境虚拟Linux系统的IP不受影响),其他不改

1.5 Installing CENTOS7

编辑虚拟机设置,设置选择安装镜像安装菜单,选择第一项    安装centos Linux 7    测试光盘镜像并安装centos Linux 7    排查问题语言,简体中文软件,安装源,自定义安装,保持默认安装最小安装安装目标位置,其他存储选项,我要配置分区,完成,    标准分区,    + boot 200M,    + swap 4096M 内存的两倍(内存大于4G,建议最大8G swap)    + /  剩余所有空间    完成,接受更改,其他不改,开始安装安装界面,用户设置,root设置密码安装完成后重启

1.6 Configure IP on

dhclient  自动获取IPip add    IP地址显示vmware,虚拟网络编辑器,NAT设置网卡配置ls /etc/sysconfig/network-scripts/ifcfg-ens33ls /etc/sysconfig/network-scripts/ifcfg-lo    网络回环

1.7 Configure IP under

vi /etc/sysconfig/network-scripts/ifcfg-ens33dhcp  自动获取static  静态IPONBOOT=yesIPADDR=192.168.98.128NETMASK=255.255.255.0GATEWAY=192.168.98.255DNS1=199.29.29.29systemctl restart network.service

1.8 Troubleshooting network problems

  Switch Bridge try the lower right corner of the virtual machine, network icon, settings, network connection Select bridge mode dhclient-rdhclientifconfig switch back to NATVMnet8, remove re-add, select NAT Mode Route-n Missing Gateway reconfiguration IP information, Discovery Gateway and DNS error [[email protected] ~]# cat/etc/sysconfig/network-scripts/ifcfg-ens33 type= Ethernetproxy_method=nonebrowser_only=nobootproto=staticdefroute=yesipv4_failure_fatal=noipv6init=yesipv6_ Autoconf=yesipv6_defroute=yesipv6_failure_fatal=noipv6_addr_gen_mode=stable-privacyname=ens33uuid= 1a636b6d-bbb6-4a45-90b7-85d7028cdb35device=ens33onboot=yesipaddr=192.168.98.128netmask=255.255.255.0gateway= 192.168.98.2dns1=119.29.29.29[[email protected] ~]# route-nkernel IP routing tabledestination Gateway Ge Nmask Flags Metric Ref use Iface0.0.0.0 192.168.98.2 0.0.0.0 UG 0 0 ens3319 2.168.98.0 0.0.0.0 255.255.255.0 U 0 0 ens331, ping 192.168.98.128 in Windows can ping 2, virtual machine Lin The UX can ping www.qq.com ping 192.168.98.2 normal ping pass 3, Route-n Gateway and route display normal yum install-y net-tools  

1.9 Remote connection to Linux using putty

Session,Host Name,输入Linux的IP地址Saved Session ,添加一个会话名称Window,lines of scrollback,设置滚动显示行数Window,Appearance,Fonts Counter ,change 设置字体大小

1.10 using Xshell to connect to Linux

新建会话,连接名称;输入想要显示的名称,主机;Linux主机IP地址用户身份验证;用户名 root外观;设置适合的字体大小其他无需设置比putty的优势:多窗口,窗口排列

1.11 Putty Key authentication

一对加密的字符串,相当于一把锁一把钥匙,私钥和公钥配对成功才可以连接上生成密钥对开始菜单,putty,puttygen,Generate生成密钥(生成密钥时,快速移动鼠标可以快速完成),建议设置个密码,增加安全性,save public key私钥必须另存为一个文档公钥复制mkdir /root/.sshchmod 700 /root/.sshvi /root/.ssh/authorized_keysi 粘贴 公钥关闭 selinuxsetenforce 0exit重新打开putty点对应的Session load,再点左侧的SSH,Auth 最后一栏 browser 选择私钥的位置在session里点save保存

1.12 Xshell key authentication

生成密钥   工具,新建密钥生成向导,2048 ,设置易于记住的密钥名称,保存设置Xshell为密钥认证登陆   会话属性,用户身份验证,方法,public key,用户密钥,选择刚设置的密钥名称,输入密码,保存,重新连接,自动登陆

1.13 Single-User mode

重启Linux    reboot    init 6    shutdown -r now关机    init 0    poweroff    shutdown -h now单用户模式修改密码    开机时,选择启动菜单,e    找到linux16开头的这一行,光标定位到ro,改为 rw init=/sysroot/bin/sh     Ctrl+x 快捷键,进入命令行界面(相当于安全模式)    ls /sysroot/boot/    cat /sysroot/root/.ssh/authorized_keys    chroot /sysroot/    passwd root  (中文安装的显示有乱码)    LANG=en    passwd root    touch /.autorelabel   (无这一步无法登陆系统)    重启Linux主机

1.14 Rescue Mode

init0  关机模式1  救援模式23  多用户模式45  多用户GUI模式6  重启光盘启动,开机安装界面,Troublesbooting,Rescue a CentOS Linux system,回车再回车,选1继续,回车,进入shellls  /mnt/sysimage/root/.ssh/authorized_keyscat /mnt/sysimage/root/.ssh/authorized_keyschroot /mnt/sysimage/passwd root改完密码重启

1.15 Cloning a virtual machine

关闭虚拟机,虚拟机选项,管理,克隆创建链接克隆开机修改IP,且UUID删掉设置主机名hostnamectl set-hostname aming-02

1.16 Linux hosts log in to each other

ssh 192.168.98.130ssh [email protected]ssh -p 22 [email protected]ssh-keygen cat /root/.ssh/id_rsa.pub  把公钥复制到01上去getenforcesetenforce 0  关闭

I don't know what the problem is.
1.15 Just after the encounter can not connect the network, over time and good, did not change the configuration file
1.16 Host 1 added host 2 public key, host 2 connection host 1 still need password

DAY01 Amin Linux Learning

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.