Linux Learning Note 3:linux Network configuration, RPM package, Shell and Samba server usage and installation

Source: Internet
Author: User

1, linux shell "Linux command, editor and Shell Programming" (1) shell kinds of many, commonly used three, in Linux can be ls-l/bin/*sh to show all installed shell Type 1) bourne/bin/sh 2 ) C/bin/csh 3) Kom/bin/ksh (2) See what kind of shell command is currently used to see what the contents of this can be known as env means that you can display the environment variables of the current operating system

(3) The instructions used to modify the shell version are: chsh-s input new shell such as:/bin/csh such as: Chsh-s/bin/csh can (4) Shell command completion function refers to the user Input command, do not need to enter the full command, And the system automatically finds the name that best matches it.  This feature saves time when you frequently enter commands. Directly enter "MK"----and then press the "tab" key-----There are two letters "MK" at both ends of all commands. Cat P then press the TAB key twice to see all the files or directories that begin with "P". (5) Review history under Linux, we may sometimes want to know or use recently executed commands.  History may be a big help. 1) History 5 This description displays the 5 most recently used commands.  History displays all the commands that were recently used. 2)! 5 This indicates that the execution force is command number 5 3)! LS This description executes the last command that starts with "LS"

2, TCP/IP based on TCP/IP, Volume 1: Protocol, "TCP/IP Detailed, Volume 2: Protocol", "TCP/IP Detailed, Volume 3: Protocol" (1) OSI model (seven Layer theory layering): Application layer, presentation layer, session layer, Transport layer, network layer, data link layer, physical layer. TCP/IP (actual four-tier use): Application layer, Transport layer, network layer (IP location IP address and determine link path), Link layer (link and hardware-driven dialog) Its main process is: (sender) The first user by sending a message, the system by packaging the message into a package, and then after the application layer, The packet header before the addition of an app header, indicating the package is which application, then, into the transport layer, then add a TCP header on the Baotou, and then through the IP layer, then add an IP header, which will be sent to the destination address, at this time the package is called the packet, and finally through the link layer, Adds a frame header and a frame footer to the packet. Sent to the network card on the computer to send to other devices. (accept) The first destination of the network card received the corresponding packet, then through the link layer to remove the frame head and frame at the end of the IP layer, the IP header is removed, after the transmission layer to remove the TCP head, finally through the application layer to remove the app header.

(2) IP address and packet reason transmission relationship each host and router on the Internet has an IP address, which includes the network number and the host number, the general network number is assigned by the international standard, the host number is the assigned IP class after several as it can use the number of hosts. All IP addresses are 32-bit, and the IP address is divided into five categories according to international standard A,b,c,d,e. Class A: 1.0.0.0-----127.255.255.255 Class B: 128.0.0.0-----191.255.255.255 Class C: 192.0.0.0-----223.255.255.255 Class D: 224.0.0.0-----239.255.255.255 Class E: 240.0.0.0-----247.255.255.255

Under Windows, the ipconfig command looks at the network configuration, and under Linux ifconfig commands to view the IP situation. The command to view the IP address of the other domain name is: Ping the domain/IP address to see how many gateways have been routed: tracert domain/IP address

3, Linux network Environment Configuration (1) Linux network environment configuration The first way: 1) Log in as root, run the Setup command into the text mode Setup Utiliy interface to the network configuration.  Here you can do IP, subnet mask, default gateway, DNS settings. 2) The configuration of the NIC does not take effect at this time. Run the/etc/rc.d/init.d/network Restart command, just set it to take effect

(2) Linux network environment Configuration The second method: 1) ifconfig eth0 x.x.x.x to the network card settings 2) ifconfig eth0 network x.x.x.x subnet mask settings for broadcast address and DNS use default. Note: This configures the network to take effect immediately, but it is temporarily in effect, and the original network settings are restored after the system restarts. (3) Linux network environment Configuration The third method: 1) Modify the/etc/sysconfig/network-scripts/ifcfg-eth0 this file inside the various properties can be modified, including IP, subnet mask, broadcast address, the default gateway.  That is Vi/etc/sysconfig/network-scripts/ifcfg-eth0 2) the configuration of the network card is not in effect, run/etc/rc.d/init.d/network Restart command We just made the changes will take effect.   This method is the lowest-level modification method. In Linux, all the devices are files.

(4) How Windows and Linux networks ping each other:

4. RPM Package Management RPM Package management is a package and installation tool for the Internet download package, which is included in some Linux release versions. It generates files with the. rpm extension. RPM is an abbreviation for the Redhat Package Manager (Redhat Packages management tool), which, despite the Redhat logo, is open to the original design concept. RPM Package name format: apache-1.3.23-11.i386.rpm, where "Apache" software name, "1.3.23-11" software version number, major version and minor version, "I386" is the software running hardware platform, "rpm" file extension, The representative is the RPM package.

(1) RPM Common Command rpm-qa: Query the installed RPM package. For example: Rpm-qa|more rpm-qa|grep X rpm-q Package Name: Whether the query package is installed. Example: Rpm-q xinetd rpm-q foo rpm-q xinetd file bash RPM-QI Package Name: Query package information. For example: Rpm-qi file RPM-QL Package name: Query the files in the package. Example: Rpm-ql file rpm-ql jdk rpm-qf full pathname: The package to which the query file belongs. such as: rpm-qf/etc/passwd rpm-qf/root/install.log rpm-qp Package file name: The information of the query package is introduced to this package. such as: Rpm-qp jdk-1_5_0-linux-i586.rpm

(2) Install RPM package Rpm-i RPM Package Full path name: Represents the installation package to the current system. Where I represents the install

RPM-IVH RPM Package Full path name: Indicates the installation package to the current system has the prompt information parameter description: I=install installation V=verbose prompt H=hash progress bar

(3) Uninstall RPM package Rpm-e RPM Package Name: Indicates unloading RPM package. Example: Rpm-e JDK (4) Upgrade RPM Package Rpm-u RPM Package full path name such as: Rpm-u cvs-1.11.2-10.i386.rpm

5. Samba installs and configures Samba service software to implement resource sharing between Windows and Linux. The SMB communication protocol uses the C/s structure, so samba software can be phased client as a server, by executing the Samba client program, the Linux host can use the resources shared by the Windows hosts on the network, and install the Samba server on the Linux host. You can use Windows hosts to access the resources shared by the Samba server.

(1) The installation steps of Samba server are as follows: 1) Check if Samba is installed. Rpm-qa|grep Samba This command will check that the Samba package is already installed.  If it is already installed, the specific name of the Samba package will appear below. 2) Mount/mnt/cdrom load the image file to/mnt/cdrom and then go to Cd/mnt/cdrom to find the files required by the SAMBA-COMMON-2.2.7A-7.9.0.I386.RPM package client and server: RPM- IVH samba-common-2.2.7.a-7.9.0.i386.rpm RPM-IVH samba-2.2.7a-7.9.0.i386.rpm Server Software RPM-IVH samba-client-2.2.7a-7.9.0. I386.RPM Client software CD ~ Umount/mnt/cdrom unmount image file (2) file with Samba password//set up a regular user in Linux first shunping//Add users from/etc/passwd to SMBPASSWD cat/etc/passwd|mksmbpasswd.sh >/ETC/SAMBA/SMBPASSWD//And SMBPASSWD shunping

(3) Start Samba Services service SMB start start service SMB stop service SMB restart restart

First make sure Windows and Linux can be ping, then you can enter: \\linux IP address on the command line, the dialog box will pop up. Enter the user name and password: shunping and password (set the password for the user shunping Samba), you can access the shared file.

(4) Configure the network to be Windows and Linux on a network segment, IP interconnect. Ifconfig View network Information ifconfig eth0 192.168.0.34 set eth0 IP for 192.168.0.34 ifconfig eth0 down prohibit use eth0 ifconfig eth0 up open eth0

(5) Turn off the firewall in Linux (set with Setup command channel text mode) to make the network configuration effective, run the following command/etc/rc.d/init.d/network restart/etc/rc.d/init.d/xinetd Restart

(6) You can access the shared files in Linux by entering "\\IP address" in Windows. The shared directory is the user's default login directory.

(7) Basic settings for shared resources   /etc/samba/smb.conf  1) Comment: Descriptive text for shared resources. The default value is an empty string.  comment =dir for Todayhero: Indicates that this directory is Todayhero for this user.  2) Path: If the shared resource is a directory, the location of the directory is specified.  path =/tmp: Indicates shared tmp this directory  3) guest OK: Allows users to access this resource without using an account and password  guest ok=yes: Indicates that the user is allowed to access this resource without using an account and password  guest Ok=no: Indicates that the user is not allowed to access this resource without using an account and password  4) hosts allow: Sets the address of the connection host  hosts allow=192.168.0.0 server.abc.com: Represents the Allow from 192.168.0.0 or server.abc.com access to this Samba server shared resource  5) hosts deny: Sets the host address of the Forbidden link  hosts deny=192.168.0.0 Server.abc.com: Indicates not allowed from 192.168.0.0 or server.abc.com access to this Samba server shared resource  6) Read only: Used to set whether the shared resource is read-only  read only= Yes: Allow read-only         Only=no: not only read-only, but also write  7) writable: Sets whether to allow write   Writable=yes: Allow write  writable=no: Allow write to  8) Browseable: Set whether users can see this shared resource  browseable=yes: Allow users to see secondary resources   Browseable=no: Do not allow users to see secondary resource  9) available: Set whether resource sharing is enabled  available=yes: Enable resource sharing  available=no: Do not enable resource sharing  

Linux Learning Note 3:linux Network configuration, RPM package, Shell and Samba server usage and installation

Related Article

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.