Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Linux server-basic settings

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Centos resolution

The resolution of the newly installed Centos 7 in virtualbox should be 800mm 600 by default. If the "minimize installation" Centos7 enters command mode. If you have installed Centos7 with GUI, you can switch between command mode and desktop mode by using the Ctrl+Alt+F1/F2/F3/F4 assembly in desktop mode. Enter command mode to start the modification operation: enter the following command:

[root@localhost ~] # gedit / boot/grub/grub.conf

1. Modify the grub.cfg file: add "vga = ask" at the end of the label, and then save the grub.cfg file.

Vga = ask means that the resolution is asked at the beginning of each time. If determined, you can also change the ask to a specific resolution reference (shown below).

2. Restart reboot and you will see the following interface:

Choose the appropriate resolution according to your screen, enter the resolution code and enter to confirm. For example, my computer chooses the last item and enters the code "34c"

Boot waiting time

You can configure the boot waiting time by modifying the file "/ boot/grub/menu.lst", where timeout is the boot waiting time. It is recommended to keep it above 2s.

[root@localhost ~] # gedit / boot/grub.menu.lst

Default=0

Timeout=5

Splashimage= (hd0,0) / grub/splash.xpm.gz

Hiddenmenu

Title CentOS (2.6.32-431.el6.i686)

Default startup mode

1. You can modify the default startup mode through the configuration file "/ etc/inittab". Open the configuration file and see the following

[root@localhost ~] # gedit / etc/inittab

# Default runlevel. The runlevels used are:

# 0-halt (Do NOT set initdefault to this)

# 1-Single user mode

# 2-Multiuser, without NFS (The same as 3, if you do not have networking)

# 3-Full multiuser mode

# 4-unused

# 5-X11

# 6-reboot (Do NOT set initdefault to this)

#

Id:5:initdefault:

The last line is the default startup mode, we can change 5 to 1, so that the graphical interface will not be started.

2. For the serial number after id, the explanation is as follows

0

Shutdown

one

Single user mode

two

Multi-user command mode, no network

three

Multi-user command mode, with network

four

Keep

five

Multi-user mode of graphical interface

six

Restart

Ps: in a system with a graphical interface installed, the graphical interface starts by default.

Open and start the numeric keypad

1. Modify the configuration file "/ etc/rc.local" to read as follows

[root@localhost ~] # gedit / etc/rc.local

Touch / var/lock/subsys/local

INITTY=/dev/tty [1-8]

For tty in $INITTY; do

Setleds-D + num < $tty

Done

2. Save and exit.

Information before and after login

By default, only the operating system and kernel version can be displayed before Centos login, and no information is displayed after login. Users are free to add some information and display it before or after login

1. Before logging in

Modify the configuration file "/ etc/issue", add a welcome to centos at the end, save and exit

[root@localhost ~] # vim / etc/issue

CentOS release 6.5 (Final) / / issue file

Kernel\ r on an\ m

Welcome centos

When you log in to the account again, you can see the following results

CentOS release 6.5

Kernel 2.6.32

Welcome to centos / / Information displayed before login

Localhost login

2. After logging in

Modify the file "/ etc/motd" and enter your contents, such as "already login"

[root@localhost ~] # vim / etc/motd

Already login

Save, log in again, and see the following

Localhost login: root

Pass

Last login: Fri Aug

Already login

Automatic error correction path

When entering a path on the command line, errors are inevitable. Centos provides a tip: you can correct the wrong path, but not too much.

1. Modify the configuration file "/ etc/bashrc" and add a sentence at the end

[root@localhost ~] # gedit / etc/bashrc

Shopt-s cdspell

2. Log in again after saving and test it.

[root@localhost ~] # cd / medai

/ media

Ps: this only applies to situations with fewer errors at that time.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report