Linux Assorted Finishing

Source: Internet
Author: User
Tags save file ssh port rdesktop

64 execute 32-bit programs in the system:

1. Execute 32-bit program in 64 system if the/lib/ld-linux.so.2:bad ELF interpreter:no such file or directory appears, install Glic

sudo yum install glibc.i686

2. Error while loading shared Libraries:libz.so.1:cannot open Shared object file:no such file or directory

sudo yum install zlib.i686







Add your own users to the sudo group:

First need to switch to root identity
$SU-
(Note there--this is different from Su, when using the command "SU" only switch to root, but not the root environment variables passed, or the current user's environment variables, with the "Su-" command to bring the environment variables, as with the root login)

And then
$visudo//Remember that there is no space between VI and sudo here

1. Move the cursor to the last line
2, press A, enter the Append mode
3. Input
Your_user_name all= (All) Example: Test all= (All) all
4. Press ESC
5. Enter ": w" (Save file)
6. Enter ": Q" (exit)

This will add yourself to the sudo group and you can use the sudo command.




When installing the Oracle database, be aware of the/etc/hosts and/etc/sysconfig/network file hostname consistency,
Otherwise, you may run NETCA and DBCA later with an error message.
For example: The/etc/hosts file contains the following:
192.168.164.129 mail.boson.com
127.0.0.1 localhost.localdomain localhost

/etc/sysconfig/network content is as follows:
#NETWORKING_IPV6 =yes//The line has been commented
Networking=yes
Hostname=mail.boson.com




Linux Check memory and disk

grep memtotal/proc/meminfo//Check memory size
memtotal:512236 KB

grep swaptotal/proc/meminfo//Check swap partition size
swaptotal:1574360 KB

DF-H//Check disk partition size




Linux Set TEMP variable:
Directly in the terminal input export followed by the temporary variable content,
Example: $ export lang=en_us//Set temporary environment variable, solve the problem of garbled display of Oracle GUI



Linux: What is the main function of command gedit?

A text editor, like a win Notepad. But it's in the Windows mode. Under Linux The most popular text editor is VI recommended that you use VI. Don't use Gedit.

In addition, you can use Gedit to modify the file to see the permissions are not all files have the right to modify unless you are root.




Chown Attribution File Owner command:

Example: Change the owner of the Install.log to bin this account:
[Email protected] ~]# Chown bin Install.log
[Email protected] ~]# ls-l
-rw-r--r--1 bin users 68495 June 08:53 Install.log
Example: Change the owner group of the Install.log back to root:
[Email protected] ~]# chown root:root Install.log
[Email protected] ~]# ls-l
-rw-r--r--1 root root 68495 June 08:53 Install.log



To update the Yum Source:
After installing CentOS6.3, in order to avoid installing updates from foreign sites too slow, you need to change the Yum update source, so from the Internet to find a way to change the Linux yum source, and everyone to share.
The simple principle is to change the update source in the Yum configuration file, which is directly using the configuration file in the 163 mirror site.

Note: You can use Yum grouplist to see which lists may be installed in bulk

1. Enter the Yum configuration file directory

cd/etc/yum.repos.d/

2. Backup configuration file

MV Centos-base.repo Centos-base.repo.bak

3, download the configuration of 163

Wget Http://mirrors.163.com/.help/CentOS6-Base-163.repo, the downloaded file is named Centos6-base

4. Renaming

MV Centos6-base-163.repo Centos-base.repo

5. Update the database

Yum Update




Using Rdesktop to connect Windows 3389 under Linux


3389 required software for connecting Windows under Linux: rdesktop-1.6.0

Linux commune local Download rdesktop-1.6.0

Installation:./configure;make;make Install

Use command: Rdesktop-u administrator-g 80% 192.168.0.254

Work is generally open two computers, a Linux, a Windows, used to use a virtual machine or something, but sometimes run up a very uncomfortable and muddy,
So slowly accustomed to the work of two computers, in general, I have a lot of time under Linux. Remote control of Windows with Rdesktop it's not okay.
Redesktop use simple, Windows also do not and what server, is to put Remote Desktop Sharing open on the line, see below how rdesktop use it, open a terminal bar

$ info rdesktop//Check the Help information.

$rdesktop 192.168.1.1//Open a 8-bit color

$rdesktop-A 16 192.168.1.1//This is a 16-bit color, it looks much better.

$rdesktop-U administrator-p ******-a 16 192.168.1.1//Both landed directly, oh, almost what?

There is the-F full-screen operation,-g specifies to use the screen size-G 800*600+0+0 This +0 ah, that is, you this window on your Linux appear on the location,

Nothing else! Plus-R sound:local can get the sound back.

$rdesktop-U administrator-p ******-a 16-r sound:local 192.168.1.1

Others,-R has a lot of functions can redirect many things, look at the help will reap a lot.

Cong online to see a good article, from that copy a bar, we look at:

-R COMPORT:COM1=/DEV/TTYS0//redirect serial/dev/ttys0 to COM1
-R COMPORT:COM1=/DEV/TTYS0,COM2=/DEV/TTYS1//multiple serial port redirection
-R disk:floppy=/mnt/floppy//redirect/mnt/floppy to remote shared disk ' floppy '
-R disk:floppy=/mnt/floppy,cdrom=/mnt/cdrom,root=/,c=/mnt/c//multiple disk redirection
-R clientname=//redirect disk settings display client name
-R lptport:lpt1=/dev/lp0//redirect the/dev/lp0 to LPT1
-R LPTPORT:LPT1=/DEV/LP0,LPT2=/DEV/LP1//multiple and Kouzhong directional
-R printer:mydeskjet//printer redirection
-R printer:mydeskjet= "HP LaserJet IIIP"//Printer redirection
-R Sound:[local|off|remote]//Voice redirection

Tip: If your local Chinese file name is displayed as garbled on the remote machine, you may not have the Code conversion library installed, or your encoded conversion library will not run correctly.

In addition, if you want to use the Remote Desktop client functionality in Win98, you only need to copy the Remote Desktop program in Windows xp/2003 to Windows 98.
The corresponding files can be downloaded here, altogether only 2 files, very small.





View port numbers in Linux:
NETSTAT-ANP | grep Service Name//view port number by service name

Example: NETSTAT-ANP | grep ssh

NETSTAT-ANP | grep Service Name//view service name based on port number

Example: NETSTAT-ANP | grep 22




Linux SSH Detailed change port number tutorial:

SSH one hand, the first thing is to change the default port number, to avoid being hackers easily find the port number to make a broiler.

Changing the port number is implemented by modifying the SSH configuration file, and after logging in to SSH, enter
#vi/etc/ssh/sshd_config
Find #port 22 down, go to edit mode, delete the # before Port 22, and enter the new port number on the next line, such as Port 21578 (preferably greater than 10000 max cannot exceed 65535),
After saving and exiting, terminal input/etc/init.d/sshd Restart or service sshd restart
To restart the SSH service, the SSH port will work on both 22 and 21578, exit SSH, and then log on with 21578 port to see if the connection is successful, and delete port 22 after the connection is successful.


If the no route to host solution is displayed when logging in

No route to host this occurs, usually the server installed a firewall, the port will be added to the firewall rules can
rpm-qa| grep iptables #查看是否安装了iptables防火墙

If it is installed, edit the firewall configuration file
1 vi/etc/sysconfig/iptables
2 #增加的规则 (port number to own, prohibit 22 port login can also be here to delete the rules of 22 ports)
3-a rh-firewall-1-input-m State--state new-m tcp-p TCP--dport 21578-j ACCEPT
4 Service iptables Restart #重启防火墙





The Find command in VI:

For example, when you are in VI a test.txt file, want to check find, you can
Hold down SHIFT and then press: it appears below the Test.txt

Then enter/, after successful test.txt the bottom line is shown as:
:/
You can enter what you are looking for in/after.
Example:/find//Finding Find string
Press N to find the next, and press SHIFT + N to find the previous one.


Linux LVM Logical Volume configuration:

LVM is a mechanism for managing disk partitions in a Linux environment, a logical layer that is built on top of hard disks and partitions and under the file system.
Improves the flexibility of disk partition management. RHEL5 the default installed partition format is the format of the LVM logical volume, it is important to note that the/boot partition cannot be created based on LVM and must be independent.




To set up the SSHD service boot:

Chkconfig--level 2345 sshd on
--LEVEL specifies that when the system is at 2345 RunLevel, it is usually turned on in 35, and the (on) sshd service is turned on (off)

Temporary control start Stop by:/etc/rc.d/init.d/sshd Start | Stop | Restart





Troubleshooting the installation of virtual machine tools (VMware tools) after the installation of the CentOS system mini:

To prepare, install the necessary components first.

Yum-y Groupinstall "Perl support"

Yum-y install gcc gcc-c++ automake make Kernel-devel



Then locate the server in vcenter and hook up with the VMware Upgrade tool (the graphics operation is omitted).

Mkdir/mnt/cdrom
Mount-o Loop/dev/cdrom/mnt/cdrom
Cd/mnt/cdrom

CP Vmwaretools*.*/Home

---------------------the copy is complete, you can disconnect the mount
Umount/mnt/cdrom
Rm/mnt/cdrom-rf



Cd/home

Tar zxvf vmwaretools........tgz

CD vm....../

You can then install:

./vmware_install.pl



If some of the normal, all the way to the return.

Linux Assorted Finishing

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.