008day--linux basic Network configuration and SSH service

Source: Internet
Author: User

First, the Linux network configuration

Ifconfig eno16777736 192.168.19.48/24 | eno16777736   (NIC name) 192.168.19.48/24(temporary IP address)

DNS : vim/etc/resolv.conf content display (nameserver 202.156.16.47 (DNS address))

Gateway : route add default GW (gateway address) netmask 255.255.255.0

View gateway Information : routing Table

change to static IP : cd/etc/sysconfig/network-scripts/ vim ifcfg-eno16777736(NIC name)

Change bootproto= ' static ' ------>static static meaning

After entering the VIM editor, add the following specified content under bootproto= ' static ':

ipaddr=192.168.19.48

netmask=255.255.255.0

gateway=192.168.16.254

dns1= 192.168.16.254

:Wq Save exit

Restart service :systemcal Restart Network

View DNS:cat/etc/resolv.conf

Vim/etc/hosts IP Address domain name

Set host name : hostnamectl set-hostname new_name(new hostname)

SCP /etc/hosts 192.16.19.47 (Destination IP) :/tmp #类似上传

SCP: copy /etc/hosts: file address to be copied 192.16.19.47 (Destination IP): object to be passed to /tmp: Save Address (To be preceded by:)

SCP 192.16.19.47 (Destination IP):/tmp/etc/hosts #类似下载

the client creates the lock and key : Ssh-keygen and then returns

View the locks and keys created : ls/root/.ssh

Display content :id_rsa(key) id_rsa.pub(lock)

s sh-copy id-i 192.168.19.47(Destination IP address, service-side lock)

on the service side :cd/root/.ssh

View content :ls

Display content :authorized_keys(the lock just passed over)

Now the Client Access server does not have to enter the password every time.

008day--linux basic Network configuration and SSH service

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.