Linux learning NIC configuration Putty key Login

Source: Internet
Author: User
Tags get ip

First, Linux configuration network card

1) Get IP automatically

If the DHCP client uses dhclient to obtain an IP address

2) Manual Configuration

[[email protected] ~] #ifconfig #查看ip地址

[[email protected] ~] #vim/etc/sysconfig/network-scripts/ifcfg-eth0 #打开网卡配置文件

Modify the following:

Onboot=no Change to Yes #开机启动

BOOTPROTO=DHCP changed to static #自动获得改成静态获得

To add a row:

ipdaar=192.168.x.x #桥接模式下与真机一个ip地址

netmask=255.255.255.0 #子网掩码

gateway=192.1.1.1 #网关地址

Peerdns=no #防止dhcp修好dns

dns1=8.8.8.8 #DNS地址

dns2=4.4.4.4 #DNS地址

   [[email protected] ~] #cat/etc/resolv.conf       #查看dns是否生效

   [[email protected] ~]#/etc/init.d/network restart  

   [[email protected] ~] #service network  restart   #重启网卡


Two, putty key login

  1) Create a. SSH directory under the user's home directory  [[email protected] ~] #mkdir./ssh

  2) Create the Authorized_keys file in the. SSH directory [[email protected] ~] #touch./ssh/authorized_keys

3) Modify the. SSH directory permission to 700, file Authourizd_keys to 600

4) Use Puttygen to generate key pair to save private key to copy public key to file Authorized_keys

5) Shut down the firewall [[email protected] ~] #setenforce 0 (temporarily off) permanently close edit /etc/selinux/config

Change inside selinux=enforcing to Disabled

6) Open Putty Save private key to SSH auth in session, open










This article is from the "Linux" blog, so be sure to keep this source http://1038457789.blog.51cto.com/10025869/1627971

Linux learning NIC configuration Putty key Login

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.