Management terminal interface of CentOS

Source: Internet
Author: User
Tags ssh port
1. introduction CentOS6.2 the system opens 6 consoles and a graphical interface by default. Switching and management operations on them can greatly improve work efficiency. opening multiple graphical interfaces is also very interesting. II. Details 1. graphic and character interface switch (1) start switch on/etc/initta 1. Introduction

By default, CentOS6.2 opens six consoles and a graphical interface. Switching and management operations on them can greatly improve work efficiency. opening multiple graphical interfaces is also very interesting.

II. Details 1. graphic and character interface switching

 

(1) boot switch

Open the/etc/inittab:

[Html]View plaincopy
  1. # Default runlevel. The runlevels used are:
  2. #0-halt (Do NOT set initdefault to this)
  3. #1-Single user mode
  4. #2-Multiuser, without NFS (The same as 3, if you do not have networking)
  5. #3-Full multiuser mode
  6. #4-unused
  7. #5-X11
  8. #6-reboot (Do NOT set initdefault to this)
  9. #
  10. Id: 5: initdefault:
Here, id: 5: initdefault: The GUI is opened by default, and changed to id: 3: initdefault: indicates the startup character interface. It takes more than MB of memory and cpu load to start the graphical interface, which slows down the startup speed, while the startup character interface is much faster.

If you want to enter the graphical interface after starting the character interface, enter the tty terminal and enter # startx, however, the startup interface is in English (the second graphical interface is in Chinese ), you can enter # export LC_ALL = zh_CN.UTF-8 or # export LC_ALL = zh_CN.GBK in the tty terminal (the system will prompt that the corresponding file cannot be found when there is no library), and then enter startx to start the Chinese interface.

(2) work switching

In CentOS6.2, six consoles are opened by default. run the following command to view details:

# Ps aux | grep tty | grep-v grep

In the graphic interface, you can use Ctrl + Alt + F2 + Ctrl + Alt + F6 to switch to the console with 5 characters, in the character interface, you can use Alt + F1 to Alt + F6 to switch between the six consoles (once switched back to the graphical interface, you need to use Ctrl + Alt + F to switch back the characters ).

(3) add a console

Ctrl + Alt + F7 and later F8 will open the new character interface, use in the graphical interface # startx will prompt:

If display 0 is activated, run the command # startx --: 1 to start the second graphic interface. # Startx --: 2 start the third graphical interface, and start multiple graphical interfaces in turn.

2. Management Console

 

(1) view

You can use the w command to view all the consoles currently in use:

Pts/2 is the terminal used to remotely log on to other hosts through ssh on the host. pts/5 is the terminal remotely to the local host, other tty is the character interface terminal for logon, and pts is the shell terminal.

(2) sending information

You can use # echo "helloworld">/dev/pts/5 to send messages to the remote logon host terminal, or send messages between terminals. the following information is received:

(3) killing terminals

If you want to kill the remote login user, you can use # skill-9 pts/5 in addition to closing the ssh port to kill the remote login terminal, you can also use this command to kill the character interface terminal and graphical interface terminal.

 

3. disable redundant console

 

 

Modify id: 5: initdefault: id: 3: initdefault: the graphical interface can be disabled to reduce memory and cpu consumption. The configuration file/etc/init/start-ttys.conf and/etc/sysconfig/init can close redundant tty character interface terminals to save memory.

Linux servers use remote logon. generally, pts terminals are used, while tty terminals only use about two or three local logins. others can be disabled.

In versions earlier than CentOS6, modify the/etc/inittab file and add # to comment out tty4, tty5, and tty6. CentOS6 start TTY configuration changed from/etc/inittab to/etc/init/start-ttys.conf, run the command # vim/etc/init/start-ttys.conf to change the default/dev/tty [1-6] to/dev/tty [1-3] as follows:

 

[Html]View plaincopy
  1. #
  2. # This service starts the configured number of gettys.
  3. Start on stopped rc RUNLEVEL = [2345]
  4. Env active_cmdles =/dev/tty [1-3]
  5. Env X_TTY =/dev/tty1
  6. Task
  7. Script
  8. ./Etc/sysconfig/init
  9. For tty in $ (echo $ active_cmdles); do
  10. ["$ RUNLEVEL" = "5"-a "$ tty" = "$ X_TTY"] & continue
  11. Initctl start tty = $ TTY
  12. Done
  13. End script
Then open # vim/etc/sysconfig/init:

 

Change active_cmdles =/dev/tty [1-6] to active_cmdles =/dev/tty [1-3] and restart.

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.