Common Linux server configurations

Source: Internet
Author: User

Environment: Host
: Windows XP SP2 Guest: VMWare fedora10

Linux network settings:

1. Check the Intranet IP address of the physical network card of the Local Machine: 192.168.1.252. You can ping the IP address to check whether the bridge is successful.

2. Disable the firewall in fedora10, # service iptables stop

3. Set Linux as the bridge mode in the virtual machine:

A) Select the bridge mode;

B) edit -- virtual network settings -- Host virtual network mapping. In the vmnet0 drop-down box, select the physical network card of the computer; go to the briic bridging tab -- Select Automatic bridging -- "add" -- select the physical Nic In the displayed dialog box -- OK

4. in Linux, choose system> Management> Network Device Control> Configuration> hardware. Double-click the NIC in the displayed dialog box, in the drop-down list, select eth0 -- OK -- return to network configuration -- device -- double-click the network adapter -- select the static IP address, and add: 192.168.1.2 subnet mask: 255.255.255.0 default gateway address: 192.168.1.1 -- OK -- return to network configuration -- activate. In fedora10, The ipsettings on the GUI are incorrect. You can configure/etc
/Sysconfig/networking/devices/ifcfg-eth0 file to set static IP.

TFTP Server:

1. check whether the system has installed TFTP server: # rpm-Qa | grep TFTP, if there is a prompt such as tftp-server-0.49-1.fc10.i386, it indicates that the system has installed the TFTP service, otherwise, you must install the TFTP service.

2 # configure TFTP in VIM/etc/xinetd. d/TFTP and change the disable value to No. The server_args value is the directory path of the server, which can be changed as needed.

3 # service xinetd start (chkconfig configures the service by means of six running levels of Linux services that can be started at startup. You can configure the service running status at each level through chkconfig, # chkconfig-list can list all the services in the system and their running status) start the service.

4. Disable SELinux, # Vim/etc/sysconfig/SELinux, comment out SELinux = enforceing, and change it to = disabled. Or enter the setenforce 0 command.

NFS server:

1. Configure the NFS shared directory: # Vim/etc/exports

/Aesop/rootfs * (RW, sync, no_root_squash) is the directory of the configured NFS service, that is, the directory mounted by other computers is the IP address mounted by other computers (access permission * indicates that all clients can mount the directory, RW indicates that the Client Connected to this directory has read and write permissions on this directory, and no_root_squash indicates that the Client Connected to this directory is allowed to have the root identity of this host, that is, if the user on the client is logged on with the root user, then the user on the NFS server also enjoys
Root permission). When the no_root_squash option is enabled, the connected client has the root identity of the host.

2. # lokkit disable the Firewall

3. Start the NFS server: # service NFS start. Once/etc/exports is modified, restart the NFS service # service NFS restart to display the Mount directory list # exportfs, line # Mount-t nfs localhost:/Aesop/rootfs/mnt. If the NFS service is normal (or # Check the NFS status of service NFS ), the content shown in/mnt should be consistent
The content in/Aesop/rootfs is consistent and should be able to solve the problem. Run # service NFS stop to stop the NFS service.

4. Start the rpcbind service (the old version of fedora is Portmap) # service rpcbind start (after the kernel is downloaded, a problem occurs when downloading the file system: IP-config: device 'eth0' not found. Later I thought that when Kernel configuration was possible, I didn't use make xconfig to set cs80x0 support. So I reconfigured the kernel and re-compiled the kernel !)

Wireshark Configuration:

[Root @ localhost ~] # Yum install wireshark-gnome

Automatic dependency installation!

Samba server:

Install the software using rpm-Qa | gerp Samba to check whether the samba software package is installed. If not, install the following software package.
# Rpm-IVH samba-3.2.0-1.pre3.9.fc9.i386.rpm
# Rpm-IVH samba-winbind-3.2.0-1.pre3.9.fc9.i386.rpm
# Rpm-IVH samba-common-3.2.0-1.pre3.9.fc9.i386.rpm
# Rpm-IVH samba-client-3.2.0-1.pre3.9.fc9.i386.rpm
# Rpm-IVH system-config-samba-1.2.63-1.fc9.noarch.rpm
Or you can use Yum install samba *-y. Start SAMBA service # service SMB start
(/Etc/init. d/SMB start) Start the smb service # service nmb start (/etc/init. d/nmb start) to start the nmb service. Of course, you can also use chkconfig -- level SMB 35 on to set the startup level.
Let's check whether two services are started normally. Run the command pstree | grep MB.
If it is shown as follows, It is started normally: |-nmbd |-smbd --- 2 * [smbd] |-tomboy --- 2 * [{tomboy}] configure SMB. CONF file knowledge point, Samba has four security levels, they are: Share: users do not need a user name and can log on to the Samba server user: you need to enter your username and password to log on to the Samba server. Please check your own information, not frequently used. For example, domain: Please check your own information, we can use the user level. If you are lazy, you can use share
First, back up the configuration file smb. conf.
# Cp/etc/samba/smb. conf
/Etc/samba/smb. conf. Bak
Then, check whether your security = user is user. If it is share, change it to user.
# Vi/etc/samba/smb. confworkgroup = workgroup // set workgroup Server String = % u's samba % v // description % u stands for the current Login User NetBIOS name = fedora // NetBIOS name, by default, fedora9 does not enable log file =/var/log/samba/log. % m // log file storage PATH % m your Windows host name Max log size = 50 // maximum log capacity SECURITY = user // security level, the user needs the user name and password, for the share level, do not [Share]
// Create a shared comment = samba with the Share Name
// Description Path =/tmp/share
// Shared path public = No // whether to allow access by the guest user (equivalent to guest OK = yes/no) writable = Yes // whether the write list can be written = lovehack // create a shared directory under the user list that can be written (@ represents the user group) and add permissions
# Mkdir/tmp/share
# Chmod 775/tmp/share
# Chown lovehack. lovehack/tmp/share
Add a user and test sharing. Add a user accessing Samba. Run the command smbpasswd-a username.
# Smbpasswd-A lovehack
// Lovehack is a user created in advance
Enter the password twice. Note that the password here is different from the password you log on to the system. It is only used to access the shared password.
Now we can test whether the configuration file is correct: testparm is generally correct.
Now we can use [url = file: // ip/] \ IP [/url] or [url = file: // computer name/] \ computer name [/url.
Solve the problem that SELinux in fedora10 denies access and sharing. In other versions of Linux (As5, as4, centos), after the above settings are made, access and sharing will be normal, but it does not work in fedora9. We can only see sharing, but access will be denied. Why? Because SELinux imposes limits on Samba sharing, we only need to solve the limitations on Samba in SELinux. We can set the following settings to OK, this is also the purpose of my tutorial: # setsebool-P samba_enable_home_dir on
# Setsebool-P samba_export_all_ro on
# Setsebool-P samba_export_all_rw on we can use the getsebool-A | grep Samba command
Check whether the preceding three items are enabled. If yes, your sharing will be normal. Key points:
1. go to/etc/samba to modify SMB. conf (add account, etc.) --------------------- netwrok related options ------------------------- workgroup = Nt-Domain-Name or workgroup-name, eg: midearth Server String is the equivalent of the NT Description field NetBIOS name can be used to specify a server name not tied to the hostname interfaces lets you configure Samba to use multiple interfaces
If you have multiple network interfaces then you can list the ones
You want to listen on (never omit localhost) hosts allow/hosts deny lets you restrict who can connect, and you can
Specifiy it as a per share option as well # workgroup = mygroup
Workgroup = workgroup
# Server String = Samba server version % v
Server String = feroda10
Username map =/etc/samba/smbusers
; NetBIOS name = myserver
NetBIOS name = feroda Samba; interfaces = lo eth0 192.168.12.2/24 192.168.13.2/24
; Hosts allow = 127. 192.168.12. 192.168.13. #============================ share definitions ========== ================================= [homes]
Comment = Home Directories
Browseable = No
Writable = Yes
Valid users = Charles
; Valid users = % s
; Valid users = mydomain \ % s #======================== my share work directoy ============ ========
[Mywork]
Comment = my work
Path =/work
Valid users = Charles
Writable = yes2. Modify/etc/samba/smbusers: # unix_name = smb_name1 smb_name2...
Root = administrator Admin
Nobody = guest pcguest smbguest
Charles = dhtshq (dhtshq is a Windows Account and Charles is an account in Linux)
In this way, you can log on to samba.3. log on to the samba account with dhtshq on Windows (if necessary ):
Bash-3.2 # pdbedit-A charles4. restart the samba service:
Bash-3.2 # service SMB restart
Bash-3.2 # service nmb restart or
/Etc/rc. d/init. d/SMB start
/Etc/rc. d/init. d/nmb start. Then, go to the Windows network neighbor and you will see the shared directory ---------------------------------------------------------------------------------------------------------
Sometimes, you can see the shared directory, but you do not have the permission to access it.
In this case, you can check the firewall settings (whether the port corresponding to Samba is enabled) or disable SELinux (modify/etc/SELinux/config ).
Http://user.qzone.qq.com/373131686/infocenter! APP = 2 & via = qz. hashrefresh & Pos = 1340263709

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.