Linux-unit7-9

Source: Internet
Author: User
Tags safe mode

Unit Seven

1 . Status of the process

Run, stop, hibernate, zombie process (the process is closed but still occupies memory), end

2. View process Commands

Ps-a View The processes running in the shell (-a means that only the processes in the Shell's front endcan be viewed, a means that the shell related processes)

-X View processes that are not running in the shell

-U View the users of the process

-L View process details

-F View full information about the process ( the abbreviation for complete)

-e Displays all processes in the system

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M00/88/4F/wKiom1fuR47xaB89AAoFSM9FX6o307.png-wh_500x0-wm_3 -wmp_4-s_1924747127.png "title=" 1.png "alt=" Wkiom1fur47xab89aaofsm9fx6o307.png-wh_50 "/>

Ps-aux |grep process keyword (eg:fan)

PS Ax-o%cpu,%mem,user,pid,comm View information about an item of a process

PS aux--sort +|-%cpu |%mem .... indicates that the process is ordered in the specified manner (+ denotes positive order;- indicates reverse)

650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M02/88/4C/wKioL1fuR6GAViCOAArY78UPWXo541.png-wh_500x0-wm_3 -wmp_4-s_1715461958.png "title=" 2.png "alt=" Wkiol1fur6gavicoaary78upwxo541.png-wh_50 "/>

3. control the front and back calls of processes in the shell

command & shut down terminal usage, let process run in shell background

CTRL + Z put the process into the background and stop

Jobs View process information in the background

FG Job number The specified process is recalled to the foreground

BG Job number running background stop process

Crlt+c closing the shell -hogging process

4. control the process with commands

Signal 1 Reload Process (reread the process's configuration file without stopping the process)

Signal 2 is the same as the Crtl+c function, removing the information of the process in memory

Signal 3 Clear Mouse (crtl+\) (ctrl+alt display mouse)

Signal 9 forced shutdown process

Signal - normal shutdown process

the process of starting and stopping the signal

signal Pause Process

The signal has the same effect as crtl+z.

The kill Signal PID operates on the process according to the process number

Killall signal process name action for all processes with the same process name

Pkill-u username End All processes for a user

5, user Login monitoring

View IP address:ifconfig eth0

Connect virtual machine:ssh [email protected] (virtual machine IP address)

(If the connection is not on the true input)

W View the user being connected

W-f Viewing the currently used user and displaying the location used

Last view users logged in the system

Lastb view logged in system but no successful users

6. Top Command

U username View user West information

K Signal

H Display Help screen

S enables the top command to run in Safe mode

M Toggle Display Memory Information

C Toggle Display command name and full command line

Unit Eight

1, service Management,systemctl command

Systemctl start service name Open service

Stop shutdown Service

Restart Restart Service

Reload reloading the server

Status view SERVER state

Enable to set up server boot

Disable disable server booting

List-dependencies View service dependency relationships

List-units to view all currently running services

List-unit-files Viewing the start-up of a service

Set-default multi-user.target boot not start graphics

Set-default graphical.target boot up graphics

Unit Nine

1, OpenSSH

Restart network get IP:systemctl Restart

The virtual machine is accessed before both sides are executed rm-fr/root/.ssh

SSH [email protected] -X (x means you can access the graphical interface)

2. realize remote access

SSH remote host user @ remote host IP address (ssh [email protected])

[[email protected] desktop]$ SSH [email protected] # # remote Access

The authenticity of host ' 172.25.13.11 (172.25.13.11) ' can ' t be established.

ECDSA key fingerprint iseb:24:0e:07:96:26:b1:04:c2:37:0c:78:2d:bc:b0:08.

Is you sure want to continueconnecting (yes/no)? Yes

warning:permanently added ' 172.25.13.11 ' (ECDSA) to the list of known hosts.

[email protected] ' s password: # # Enter password

Last Login:thu Sep 29 04:50:59 2016

[[email protected] ~]# Logout # # Crtl+d exit

Connection to 172.25.13.11 closed.

[Email protected] desktop]$

VIM/ETC/MOTD Setting the characters displayed when landing

650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M02/88/4C/wKioL1fuR8DwPfYEAAuxipOBxDM202.png-wh_500x0-wm_3 -wmp_4-s_895454425.png "title=" 3.png "alt=" Wkiol1fur8dwpfyeaauxipobxdm202.png-wh_50 "/>

3 . SSH key authentication

[Email protected] desktop]# Ssh-keygen

Generating public/private RSA key pair.

Enter file in which to save the key (/ROOT/.SSH/ID_RSA):

Enter passphrase (empty for no passphrase):

Enter same Passphrase again:

Your identification has been saved In/root/.ssh/id_rsa.

Your public key has been saved in/root/.ssh/id_rsa.pub.

The key fingerprint is:

26:20:15:ed:3f:5e:50:8e:69:d6:d5:d0:9c:7a:60:[email protected]

The key ' s Randomart image is:

+--[RSA 2048]----+

| Oo. *. |

|  .   . E = = |

| ... * + O |

| .... * O.  . |

|   . +s.   . |

|      Oo. |

| . o |

|        . |

| |

+-----------------+

[Email protected] desktop]# cd/root/.ssh/

[email protected]. ssh]# ls

Id_rsa id_rsa.pub

[email protected]. ssh]#

650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M01/88/4F/wKiom1fuR92D1WcUAAjv5jkeZ64115.png-wh_500x0-wm_3 -wmp_4-s_1933176703.png "title=" 4.png "alt=" Wkiom1fur92d1wcuaajv5jkez64115.png-wh_50 "/>

Ssh-copy-id upload key

-i specifies the public key used

Id_rsa.pub The name of the public key

Root managed Target user

172.25.13.11 The IP of the host on which the user is managed

Authorized_keys This file is in the target user home directory of . SSH , which is the encrypted identity of the target user, and the content is the public key.

Ssh-keygen

Ssh-copy-id-i id_rsa.pub [email protected](server-side IP) Encrypt (lock) the specified host

SCP Id_rsa [email protected]:/root/.ssh/ The secret key to the specified host (client IP)

4. sshd Service Configuration

Vim/etc/ssh/sshd_config sshd Service configuration file (set Nu display line number)

Permitroorlogin Yes | No setting allows the root user to authenticate with sshd

Passwordauthentication Yes | No turn on or off user password authentication

Allowusers Student Westos(user name) user Whitelist (users not listed cannot log in to the system plus the below)

Systemctl Restart sshd Reload configuration

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M00/88/4F/wKiom1fuSAmQiiHDAAiaC4LfFzw091.png-wh_500x0-wm_3 -wmp_4-s_3766040151.png "title=" 5.png "alt=" Wkiom1fusamqiihdaaiac4lffzw091.png-wh_50 "/>

Yum Reinstall openssh-server-y Reinstall SSH Service (if there is an error executing yum install openssh-server-y)

650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M00/88/4C/wKioL1fuSGfx9IrWAAsw3qUGjVU345.png-wh_500x0-wm_3 -wmp_4-s_470860802.png "title=" 6.png "alt=" Wkiol1fusgfx9irwaasw3qugjvu345.png-wh_50 "/>


This article is from the "12086808" blog, please be sure to keep this source http://12096808.blog.51cto.com/12086808/1858206

Linux-unit7-9

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.