Quickly learn Samba quickly

xiaoxiao2021-03-06  14

Quickly learn Samba quickly

Foreword: In Windows and Linux hybrid networks, Samba is still very useful, this paper is fast

Samba.

[experimental project]

1 Establish a Samba server on Linux, access to client SMBClient like FTP.

2 Establish Samba servers on Linux, access with Win2000 clients.

3 Establish Samba servers for Security = Share on Linux, access to Win2000 clients.

4 Mount Samba sharing on Linux.

Experiment 1: Create a Samba server on Linux, access to client SMBClient like FTP.

[Experimental Requirements]

1. Two RH8.0 machines can ping each other.

2. IP of machine 1 IP: 192.168.0.1

3. IP: 192.168.0.2 of Machine 2

[Experimental step]

1. Turn off the firewall of the two machines.

#service iptables stop

#CHKCONFIG iptables OFF

2. Install the package on the two machines.

Check if Samba, Samba-Common, whether the Samba-Client package is installed.

# rpm -q samba

# rpm -q Samba-Common

# rpm -q samba-client

According to the result, find the package that is not installed in the installation CD and starts to install.

# rpm -ivh samba * .rpm

3. Open the SMB service in the machine 1 and see what you share.

# Service SMB Start

# SMBCLIENT -L 192.168.0.1 -n

4. Add a new user in the machine 1.

# UserAdd User1

# Passwd User1

Password: USER1

# Touch / Home / USER1 / IAMUSER1

5. Create a SMB account file file in Machine 1: / etc / samba / smbpasswd

# Touch / etc / samba / smbpasswd

# SMBPASSWD -A User1

Password: USER1

6. Back up the original configuration file in the machine 1: /etc/samba/smb.conf

# Service SMB Restart

10. What do you have to share the Samba of the machine 1 on the machine 2?

# SMBCLIENT -L 192.168.0.1 -n

11. Access the Samba service of the machine 1 in the machine 2.

# SMBClient //192.68.0.1/homes -u user1% USER1

12. After successfully access it on the machine 2, use the HELP to view the command.

SMB: /> HELP

Note: 1) Use ls to see the file Iamuser1?

2) Compare and ftp commands are different.

Experiment 2: Establish Samba servers on Linux, access to Win2000 clients.

[Experimental Requirements]

1. One RH8.0 machine, a Win2k machine, can PING.

2.RH8.0, IP: 192.168.0.1

3.Win2k machine, IP: 192.168.0.2

[Experimental step]

1. On the basis of experiment, modify /etc/samba/smb.conf

Modify [global] segment:

Workgroup = Workgroup1

-------------------------------------------------- --------------------

If you are familiar with the above modification, skip this section.

Workgroup = Workgroup1 is for Linux and Windows machines in the same working group.

-------------------------------------------------- -------------------- Note: Modified SMB.conf, must run: Service SMB Restart

2. Modify WIN2K's working group, for Workgroup1, if the domain controller, must be reduced to ordinary working group, with

Administrator Restarts to log in.

Modification: "My Computer" | "Properties" | "Network Identity" | "Properties"

3. On Win2k machine, "Network Neighbor" | "Whole Network" | "All Content" | "Microsoft Windows Network"

| "Workgroup1", have you seen the RH system machine?

4. Enter your username User1, password USER1 enters, can you create, delete a file?

Experiment 3: Establish Samba Server of Security = Share on Linux, access to Win2000 clients.

[Experimental Requirements]

1. One RH8.0 machine, a Win2k machine, can PING.

2.RH8.0, IP: 192.168.0.1

3.Win2k machine, IP: 192.168.0.2

[Experimental step]

1. On the basis of the experiment 2, modify /etc/samba/smb.conf

Add below:

[public]

Comment = public

Path = / mNT

Browsable = yes

Public = yes

Modify [global] segment:

Security = Share

-------------------------------------------------- --------------------

If you are familiar with the above modification, skip this section.

[public] Defines another paragraph or other name.

PATH pointed out the shared directory.

Security uses Share.

-------------------------------------------------- --------------------

Note: Modified SMB.conf, you must run: Service SMB Restart

2. On the Win2k machine, use administrator to log in, "Network Neighbors" | "Whole Network" | "All Content" |

"Microsoft Windows Network" | "Workgroup1", have you seen the RH system machine?

3. You can enter your password, is it? Do you see a few shared directories? Can you write?

4. Create a new account on the Win2k machine: user1, password: user1.

5. Log out on the Win2k machine and switch the user USER1.

6. On the Win2k machine, "Network Neighbors" | "Whole Network" | "All Content" | "Microsoft Windows Network"

| "Workgroup1", have you seen the RH system machine?

7. You can enter your password, is it? Do you see a few shared directories? Can you write?

Note: 1) When you imitate the [Homes] section modified Writable, Create Mode, Directory Mode

Will you write?

2) How about the situation when the RH8.0 machine / MNT / read and write permission is Drwxrwxrwx?

Experiment 4: Mount Samba shares on Linux.

[Experimental Requirements]

1. One RH8.0 machine, a Win2k machine, can PING. 2.RH8.0, IP: 192.168.0.1

3.Win2k machine, IP: 192.168.0.2

[Experimental step]

1. On Win2k machine, share C: /

2. Run on RH8.0:

# SMBClient //192.168.0.2/c -u Win2K current login user name% password

Note: Can I log in?

3. Mount the shared disk:

# mount -t smbfs -o username = Win2K current login name% password

//192.168.0.2/c / mnt / cdrom

Note: 1) Do not have spaces between "UserName = WIN2K's current login name% password".

2) Also available: # SMBMount //192.168.0.2/c / mnt / cdrom -o username =

UserName = Win2K current login name% password

3) Also available: # SMBMount //192.168.0.2/c / mNT / CDROM -U

Win2K's current login user name

Then enter the password.

4) Real, two are Linux systems, one as a Samba server, another as a client. Such as

In the case of experiment, on the machine 2:

# mount -t smbfs -o usrname = user1% user1

//192.168.0.1/Homes / MNT / CDROM

Sharing can also be achieved, but there is no need, between Linux, can be shared with NFS, and the speed ratio

Samba is fast.

Experimental Summary]

This article is just simple and fast learning Sabma. If you want to know in-depth, you need to combine MANPAGE and the original.

/etc/samba/smb.conf (backed up for smb.conf.bak) carefully, in addition, / usr / share / doc / samba

Provide professional documentation can learn. However, through the learning of this article, it is basically satisfied with ordinary work needs. Until

Security is Domain and Server, I have no research, so there is no involvement

转载请注明原文地址:https://www.9cbs.com/read-47923.html

New Post(0)