Manually add the default gateway in Linux

Source: Internet
Author: User
Tags net send

Q: How do I manually add a default gateway in Linux? Http://www.21t.org.cn
A: Take the root user as an example and run the following command:
# Route add default gw xxx. XXX (IP address of the gateway)
To change the gateway, edit the/etc/sysconfig/network-scripts/ifcfg-eth0 file, modify the corresponding gateway settings, and run the following command:
#/Etc/init. d/network restart

Q: In Linux, the system sometimes does not automatically check the new hardware when it is started. The newly installed Nic cannot be found. How can this problem be solved?
A: The service of the new hardware is kudzu. You can run the "ntsysv" command to start the service. The user's new NIC will be found upon the next restart.

Q: I have a computer installed with Linux in my house. I want to remotely log on to my house from my company to perform operations. I cannot log on to my home using root for each Telnet operation. Is there a solution?
A: for the sake of security, SSH is recommended for some Linux versions that do not install Telnet by default. Of course, if you do not have high security requirements, you can log on directly with the root user. Modify/etc/PAM. d/login to comment out the following line:
# Auth required/lib/security/pam_security.so
Save and exit, and you can log on with root.

Q: In Linux, how does one monitor all data through the local Nic?
A: Use the following command:
# Tcpdump iptraf

Q: How do I disable the POP3 permission of a user?
A: Just turn off the POP3 port. Find the following line in the file/etc/services;
Pop-3 110/tcp
Add "#" before it and comment it out.

Q: How can I send a popup message to Windows on Linux?
A: Save the following script as/usr/local/bin/NET :#! /Bin/bash
#/Usr/local/bin/Net

Case "$1" in
Send)
Echo "$3" | smbclient-I "$2"-m'nmblookup-a "$2" | sed-e '1d'
-E '3,/*/d' | cut-F2 | cut-d'-f1'
;;
*)
Echo "Usage: net send <ipaddr.> <message>"
Exit 1
Esac
 
Add the execution permission to the file. The command is as follows:
# Chmod + x/usr/local/bin/Net
An example of using the net script is as follows:
# Net send 192.168.12.1 "Hello, Linux! "

Q: How do I determine whether the website exec security vulnerability exists in WU-FTPd?
A: In some Linux releases, wu-ftpd has the site exec security vulnerability. you can log on to the website through FTP as a non-Anonymous user and then execute the following command:
Ftp> site exec bash-c id
If the returned information contains "200-uid = 0 (Root) gid = 0 (Root)", this vulnerability exists and needs to be changed immediately.

Q: How does wu-ftpd allow anonymous users to upload files?
A: Create a folder that can be written to FTP users. Then, set ftpaccess as follows:
Upload/home/FTP/incoming/* Yes FTP 0400 nodirs

Q: How does wu-ftpd prohibit users from uploading files with irregular file names?
A: To Restrict Anonymous Users from uploading objects whose names contain special characters, you can set them in ftpaccess as follows:
Path-filter Anonymous/etc/paths. MSG ^ [-A-Za-z0-9. _] * $ ^. ^-

Q: How can I cancel the Linux DHCP service?
A: It depends on whether the user is using the system's built-in DHCP or installed later. The following two cases are described:
1. If the system comes with it, you can choose "start"> "System Service"> "DHCP" to stop the DHCP service and run the following command:
#/Etc/rc. d/init. d/xinetd restart
2. If it was later installed by the user, it is generally in/etc/rc. Local, and the system will shut down the DHCP service.

Q: How can tcp syn Cookie protection take effect?
A: Use the following command:
# Echo 1>/proc/sys/NET/IPv4/tcp_syncookies

Q: How do I control the size of user emails?
A: run the following command to limit it:
# Max Message Size to 1 MB
O maxmessagesize = 1000000
Restart Sendmail.

Article from: blog Zhejiang (blog.zj.com)
Reference: http://bigtidel.blog.zj.com/d-102069.html

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.