Samba server settings and Windows Access in redhat9

Source: Internet
Author: User

The main function of the samba service is to share files between machines, such as UNIX-like machines and Windows machines. It integrates the SMB and NetBIOS protocols and runs on TCP/IP. Install the Samba server today to debug and call the U-boot source code in Linux using codewarrior on Windows. Security issues are not considered in detail.

1. Install samba
1.1 first verify that samba has been installed
# Rpm-Qa | grep samba
Samba-common-2.2.7a-7.9.0
Samba-client-2.2.7a-7.9.0
Samba-2.2.7a-7.9.0
Redhat-config-samba-1.0.4-1
First, you have installed Samba in the first three instructions. If Samba does not appear, you must manually install it. RedHat-config-Samba is a graphical interface configuration tool.
1.2 manually install samba
If it is not installed, find redhat9 and put the first disc into the optical drive, it will be automatically mounted
# Cd/mnt/CDROM/RedHat/RPMS
# Rpm-IVH samba-*. rpm
# Rpm-Qa | grep Samba (check installation) 2. Configuration
2.1 Method 1-graphical Configuration
System Red Hat icon --> system settings --> server settings --> Samba Server
Enter the root password, open the Samba server configure interface, click File/Add share to bring up the create Samba share page, and Click Browse or enter the shared directory directly in directory, (For example,/home/liuby/u-boot-1.1.3/), in the basic permissions below: Select read/write permissions (for example, read/write ), in the access box, select the user (such as allow access to everyone) 2.2 Method 2-Use the configuration file
After Samba is installed, a folder named Samba is generated under/etc/, which contains some configuration files smb. conf smbpasswd smbusers LmHosts.
# Grep-V "^ [#;]"/etc/samba/smb. conf | grep-V "^ $" # display the configuration file SMB. conf. The following is the configuration file (remove comments and blank lines)
[Global]
Workgroup = mygroup
NetBIOS name = mitc_linux
Server String = Samba Server
Hosts allow = 192.168.1. 59.64.155.154 # Only allow access from this IP address
Log File =/var/log/samba/% m. log # Log File
Max log size = 5 # the log file is 5kb
Security = user # share user name and password are not required. user name and password are required.
Encrypt passwords = yes # password encryption
SMB passwd file =/etc/samba/smbpasswd # Password File
Unix Password Sync = Yes
Passwd program =/usr/bin/passwd % u
Passwd chat = * New * password * % N/N * retype * New * password * % n/n * passwd: * All * authentication * tokens * Updated * successfully *
Pam password change = Yes
Obey Pam restrictions = Yes
Socket Options = tcp_nodelay so_rcvbuf = 8192 so_sndbuf = 8192
DNS proxy = No
[Homes]
Comment = Home Directories
Browseable = no # this share is invisible to other users
Writable = yes # readable and writable
Valid users = % s # Only the owner can access the share
Create mode = 0664 # permission mask when creating a file
Directory mode = 0775 # Created directory permissions
[U-boot]
Comment = u-boot file for debug
Path =/home/liuby/c_code/u-boot-1.1.3/# specify the location of the Shared File
Writeable = yes # readable and writable 3. Configure the user
3.1 Add a user
# Smbadduser liuby: Starby
Enter the password as prompted (Note: Samba users must be system users)
# Smbpasswd-a username
3.2 disable a user
# Smbpasswd-D Username
3.3 delete a user
# Smbpasswd-x username 4. Start the service
4.1 There are two methods to restart:
# Service SMB start or restart
#/Etc/rc. d/init. d/SMB start
4.2 There are two ways to set auto-start:
# Select SMB for ntsysv
# Setup select system services and then SMB
Note: Pay attention to the server firewall settings (Setup enters the firewall configuration custom firewall rule open port 137 138 139) 5. Windows XP Access Samba Sharing Service
(1) Open a folder in Windows XP and enter the Samba server address in the address bar // 59.6 ?. 155.122 or directly specify // 59.6 ?. 155.122/U-boot
(2) In the pop-up dialog box, enter the user name and password and press enter to bring up the shared directory.
(3) input the above configuration // 59.6 ?. 155.122 enter the U-boot directory in the shared directory. Right-click the Directory and select "ing network drive" to access the folder from "My Computer.
(4) to remove the network drive, right-click "Disconnect" in "My Computer"-> "network drive ".

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.