Article Title: Install the Samba server under the Virtual Machine RedhatLinux. Linux is a technology channel of the IT lab in China. Some basic categories, such as desktop applications, Linux system management, kernel research, embedded systems, and open-source systems, have been installed with a virtual machine redhat, and samba servers have never been used, because I want to share things in my company and at home on virtual machines and windows (usually code), of course, I can solve this problem by using share in windows and mount in virtual machines, however, there are also hidden dangers. On the one hand, users do not want to see what they write. On the other hand, setting directory permissions in windows to read and write is also extremely uncomfortable. Therefore, they checked the information online, fix the samba server. Now let's summarize my installation.
First, enter rpm-qa | samba in shell to check whether the following three files exist.
# Rpm? Qa | grep samba
Samba-common-3.0.0.15.i386.rpm
Samba-client-3.0.0-15.i386.rpm
Samba-3.0.0-15.i386.rpm
If there is no such file, you can only install it. In windows, place the image file into the virtual optical drive, and the virtual opportunity will be automatically mounted, enter/mnt/cdrom/RedHat/RPMS and enter rpm-ivh samba *. rpm is enough.
Due to security concerns, you must set the access permission password for linux. Because I usually log on to the system as a root user, and here I create a new account named sumsky under redhat, enter smbpasswd-a sumsky in shell to add the sumsky user to the samba password file, and prompt you to enter the password. The default file storage location is under/etc/samba, and the file name is sampasswd. If not, create a file like this. Of course, you can also modify the default storage location in the configuration file smb. conf. This file is automatically associated with your system's passwd file.
Smb will appear under/etc/samba/after installation. conf file, that is, the samba configuration file mentioned above. Modify the options here and change the security value to user, in this way, you must enter a password in windows to access the Linux shared file. This is exactly what I want.
Next, modify smb. for the shared directory in conf, I set aside the [home] item and modified the last item. For other items, let them add the ';' sign in front of them, ignore them. The following is the last configuration I modified. sumsky is the user I created above, and the shared directory is/usr.
[myshare]comment = sumsky's stuffpath = /usrvalid usr = sumskypublic = yeswritable = yesprintable = nocreat mask = 0765
|
Now, save and exit.
Now the rest is to enable the samba service.
/Etc/init. d/smb start
Now, I am not in a rush to enter an ip address in windows. First, try it. My windows IP address is 192.168.0.11, and the virtual machine is 192.1168.0.12. Enter
Smbclient-L 192.168.0.11
This command is used to connect to the host 192.168.0.11, that is, windows.
Smbclient-L 192.168.0.12
Connect to itself
If neither of these two commands is reflected, the redhat firewall may be playing a strange role.
Input
Iptable-F
Clearing firewall rules is a lazy practice. I am just lazy.
Now try the two commands above, which can be connected.
The rest is to enter the Virtual Machine IP address in windows, open my computer, enter \ 192.168.1.12 in the status bar, and a prompt will be prompted to enter the password, enter the password you created when creating the samba user (not the logon password. This is a two-case code. That is to say, you have an account, a password for logging on to the system, and a password for logging on to the samba server ), now we can see the shared directory under the linux for a long time.