Common SuSE Linux configurations and commands

Source: Internet
Author: User

FTP configuration (vsftpd ):

 

Method 1: ftp runs as an independent process.

1. Install vsftpd (not installed by default ).

 

2. Modify/etc/vsftpd. conf and setListen = YesThat is, enable ftp to run in standalone mode.

 

3. Run chkconfig vsftpd off and disable xinet for FTP management.

 

4. Run/usr/sbin/vsftpd to enable ftp

 

5. Pay attention to the firewall settings; otherwise, access will fail.

 

6. Pay attention to the FTP permission setting/etc/vsftpd. conf. Otherwise, the FTP cannot be accessed. Simplest settings:

Anonymous_enable = No/do not enable Anonymous Access/

Local_enable = Yes/enable the Local User Logon Service/

Write_enable = Yes/Enable write permission for any user/

 

 

Method 2: ftp runs as a service managed by xinetd.

1. Install vsftpd (not installed by default ).

 

2. Modify/etc/vsftpd. conf and set# Listen = YesThat is, disable the standalone mode of FTP.

 

3. Run chkconfig vsftpd on and enable xinet to manage FTP.

 

4. edit/etc/xinetd. d/vsftpd, set disable = No, run/etc/rc. d/xinetd restart, and restart xinetd.

 

5. Pay attention to the firewall settings; otherwise, access will fail.

 

6. Pay attention to the FTP permission setting/etc/vsftpd. conf. Otherwise, the FTP cannot be accessed.

 

 

Route Configuration:


Default route: Route add default GW 192.168.0.1

Add a route entry: Route add-net x. x netmask route 255.255.0 GW x. x Dev ethx

 

Firewall Configuration:

 

Configuration file:

/Etc/sysconfig/susefirewall2

 

Compare the RedHat firewall configuration file:

/Etc/sysconfig/iptables

 

 

View System logs Syslog

 

 

Suse10 modify the/etc/bash. bashrc file and add: alias log = 'Tail-F/var/log/messages'

In this way, you can use the log command to quickly view system logs.

Modify the/etc/profile file in RedHat. This is different from Suse.

 

Start and Stop services

For example, start the crond service:

/Etc/rc. d/cron start

/Etc/init. d/cron start

Stop:

/Etc/rc. d/cron stop

/Etc/init. d/cron stop

 

Make remote logon unavailable to non-root users

Create a/etc/nologin file. Otherwise, delete the/etc/nologin file.

 

 

 

Java environment settings

Open the/etc/profile file and add the following content at the end:
Export java_home =/usr/jdk1.6.0 _ 01
Export Path = $ path: $ java_home/bin
Export classpath =.: $ java_home/JRE/lib: $ java_home/lib/tools. Jar

Save and exit. Run in the terminal:

Source/etc/profile # Make the settings take effect

Run again
Java-version

 

View Java Processes

PS-Ef | grep Java | awk '$8! = "Grep" {print $0 }'

 

 

Common compression commands

 

. Tar
Unpack: Tar xvf filename.tar
Package: Tar CVF filename.tar dirname
(Note: tar is packed, not compressed !)
---------------------------------------------
. GZ
Decompress 1: gunzip filename.gz
Decompress 2: gzip-D filename.gz
Compression: gzip filename
.Tar.gz and. tgz
Decompress: Tar zxvf filename.tar.gz
Compression: Tar zcvf filename.tar.gz dirname
---------------------------------------------
. Bz2
Decompress 1: Bzip2-D filename.bz2
Decompress 2: bunzip2 filename.bz2
Compression: Bzip2-Z filename
.Tar.bz2
Decompress: Tar jxvf filename.tar.bz2
Compression: Tar jcvf filename.tar.bz2 dirname
---------------------------------------------
. Bz
Extract 1: Bzip2-D filename. bz
Decompress 2: bunzip2 filename. bz
Compression: Unknown
. Tar. bz
Decompress: Tar jxvf filename.tar. bz
Compression: Unknown
---------------------------------------------
. Z
Decompress: uncompress filename. Z
Compression: compress filename
. Tar. Z
Decompress: Tar zxvf filename.tar. Z
Compression: Tar zcvf filename.tar. Z dirname
---------------------------------------------
. Zip
Decompress: unzip filename.zip
Compression: Zip filename.zip dirname
---------------------------------------------
. Rar
Decompress: rar a filename.rar
Compression: R ar e filename.rar
  
RAR Please download to: http://www.rarsoft.com/download.htm!
After decompression, copy rar_static to the/usr/bin directory (Other Directories specified by the $ PATH environment variable can also be used ):
[Root @ WWW] # cp rar_static/usr/bin/RAR
---------------------------------------------
. LHA
Decompress: LHA-e filename. LHA
Compression: LHA-a filename. LHA filename
  
Lha please: http://www.infor.kanazawa-it.ac.jp /~ Ishii/lhaunix/download!
> After decompression, copy LHA to the/usr/bin directory (Other Directories specified by the $ PATH environment variable can also be used ):
[Root @ WWW] # cp LHA/usr/bin/
---------------------------------------------
. Rpm
Unpack: rpm2cpio filename. RPM | cpio-Div
---------------------------------------------
. Deb
Unpack: Ar P filename. Deb data.tar.gz | tar zxf-
---------------------------------------------


 

Crontab User Manual

The crontab command schedules the execution of some commands at certain intervals. There is a crontab file in the/etc directory, which stores some scheduling programs that are running systematically. Each user can create their own scheduling crontab.

The crontab command has three forms of command line structure:

Crontab [-u user]

Crontab [-u user] [-E |-L |-R]

Crontab-l-u [-E |-L |-R] In the first command line, file is the name of the command file. If this file is specified in the command line, run the crontab command to copy the file to the crontabs directory. If this file is not specified in the command line, the crontab command will accept the commands typed on the standard input (keyboard) and store them in the crontab directory.

In the command line, the-r option is used to delete the crontab file from the/varr/spool/cron/tabs directory;

In the command line, the-L option is used to display the contents of the crontab file.

Run the crontab-u user-e command to edit the cron (c) job of the user. You can edit a file to add or modify any job requests.

Run the crontab-u user-R command to delete all cron jobs of the current user.

Jobs and their scheduled time are stored in the file/varr/spool/cron/tabs/username. Username stores the user name in the corresponding file with the command that the user wants to run. The command execution result, whether it is standard output or error output, will be sent to the user in the form of mail. Each request in the file must contain six fields separated by spaces and tabs. The first five fields can take an integer to specify when to start working. The sixth field is a string called a command field, which includes the crontab command for scheduling and execution.

The value range and significance of the integer in the first and fifth fields are as follows:

0 ~ 59 indicates the score

1 ~ 23 indicates the hour

1 ~ 31 indicates the day

1 ~ 12 indicates the month.

0 ~ 6 indicates the week (0 indicates Sunday)

/Usr/lib/cron. allow indicates who can use the crontab command. If it is an empty file, it indicates that no user can schedule a job. If this file does not exist and another file/usr/lib/cron. deny exists, the crontab command can be used only by users not included in this file. If it is an empty file, it indicates that any user can arrange jobs. If both files exist at the same time, cron. allow takes priority. If neither of them exists, only the Super User can schedule a job.

 

 

Prevent crontab from sending alert emails

 

By default, if the cron program encounters a problem during execution, it will send an email to the user's local mailbox. If the cron program has been running for a long time or encounters a problem, the cron will execute the command, the number of emails generated will be huge. How can I disable the email alarm function? The solutions are as follows:

* 1. Redirect the command execution information

Cron_command>/dev/null 2> & 1

* 2. Redirect the command execution information

Cron_command &>/dev/null

* 3. Specify the email to be sent in the crontab setting file.

Mailto = ""

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.