The whole process is actually very simple. For the general steps, please refer to here:
Samba enables file sharing between Ubuntu and windows
Http://spiritfrog.iteye.com/blog/216768
After reading this, I know that I just want to install samba-related stuff:
Sudo apt-Get install samba-client samba-common
You can install the samba service normally.
After the installation is complete, find a folder, right-click and select "Share Option", and set the sharing, but an error occurs.
"Failed to execute the sub-process" testparm "(there is no file or directory)", and then refer to here:
Http://crabdave.iteye.com/blog/639921
That is, install another Samba:
Sudo apt-Get install samba-common-bin
To solve the problem.
Follow the prompts in the previous post to start the samba service:
Sudo/etc/init. d/samba start
The result is that there is no corresponding Samba under/etc/init. d, only SMB:
Crifan @ crifan-ubuntu10 :~ $Ls/etc/init. d/smbd-l
Lrwxrwxrwx 1 Root 21/etc/init. d/smbd->/lib/init/upstart-job
The result of executing the SMB fails:
Crifan @ crifan-ubuntu10 :~ $Sudo/etc/init. d/smbd start
Rather than invoking init scripts through/etc/init. d, use the service (
Utility, e.g. Service smbd start
Since the script you are attempting to invoke has been converted to
Upstart job, you may also use the START (utility, e.g. Start smbd
Follow the prompts to start the samba service:
Crifan @ crifan-ubuntu10 :~ $Sudo service smbd start
Start: job is already running: smbd
In addition, you need to add Samba users. Remember that in other Linux systems, there are graphical user interface tools to configure samba, rather than using command lines.
Later, inadvertently, here:
Http://www.linuxidc.com/Linux/2010-12/30305.htm
Find what I want and install the prompt to install the samba graphic management interface:
Sudo apt-Get install system-config-samba
Then, you can start the samba GUI through system> System Management> Samba.
Note that before adding a user to Samba, you must ensure that the user already exists in the system. Therefore, for this requirement:
Only one tq2440 user is allowed to access one of my folders.
The specific setting method is as follows:
1. First create this user in the system
Before adding Samba shares, go:
System> System Management> users and groupsTo create a tq2440 user.
2. Add the user to the samba user
System> System Management> samba -> Samba server configuration-> preferences-> Samba users-> Add users, Find the corresponding tq2440, and then confirm.
3. Create a new share and set the samba user to access
Create a new share in Samba and set the user tq2440 to access the folder/file.
That is, because you have added the samba user before, you can select tq2440 only when you see the tq2440 user in "only allow access to the specified user.
In this way, the sharing is completed.
Go to Windows and enter the IP address of the computer where Ubuntu is located. You can view the IP address through ifconfig:
Crifan @ crifan-ubuntu10 :~ $Ifconfig
Eth0 link encap: Ethernet hardware address 44: 87: FC: 0d: 2a: 10
Inet address:192.168.1.101Broadcast: 192.168.1.255 mask: 255.255.255.0
Inet6 address: fe80: 4687: fcff: fe0d: 2a10/64 scope: Link
Up broadcast running Multicast MTU: 1500 hops: 1
Received data packet: 65620 error: 0 discard: 0 overload: 0 frames: 0
Send data packets: 54996 error: 0 discard: 0 overload: 0 carrier: 0
Collision: 0 sending queue length: 1000
Received byte: 76313596 (76.3 MB) sent byte: 6204077 (6.2 MB)
Interrupt: 43 basic address: 0x2000
Lo link encap: local loopback
Inet address: 127.0.0.1 mask: 255.0.0.0
Inet6 address: 1/128 scope: Host
Up loopback running MTU: 16436 hops: 1
Received data packet: 66 error: 0 discard: 0 overload: 0 frames: 0
Packet sending: 66 error: 0 discard: 0 overload: 0 carrier: 0
Collision: 0 sending queue length: 0
Received byte: 7882 (7.8 KB) sent byte: 7882 (7.8 KB)
Wlan0 link encap: Ethernet hardware address 48: 5D: 60: 1D: 85: 9C
Up broadcast multicast MTU: 1500 hops: 1
Received data packet: 0 error: 0 discard: 0 overload: 0 frames: 0
Packet sending: 0 error: 0 discard: 0 overload: 0 carrier: 0
Collision: 0 sending queue length: 1000
Received byte: 0 (0.0 B) sent byte: 0 (0.0 B)
Interrupt: 16 memory: f8078000-f8078100
If the corresponding lan ip address is 192.168.1.101, enter the following in the address bar of the resource manager on another Windows Server:
\ 192.168.1.101
That is to say, we can see the folders shared through Samba in Ubuntu. There is no difference between them and other common windows.
Note:
[Check whether the samba service has been started]
PS-Aux
If there are too many processes:
Crifan @ crifan-ubuntu10 :~ $PS-Aux | grep smbd
Warning: Bad PS syntax, perhaps a bogu '-'? See http://procps.sf.net/faq.html
Root 5426 0.0 0.2 16704 4160? SS smbd-F
Root 5439 0.0 0.0 16704 1236? S smbd-F
Root 6527 0.0 0.2 17012 4176? S smbd-F
Crifan 6873 0.0 0.0 5628 764 pts/0 S + grep -- color = auto smbd
If smbd is found, the samba service is started.
In addition, check whether the nmbd service has been started:
Crifan @ crifan-ubuntu10 :~ $PS-Aux | grep nmbd
Warning: Bad PS syntax, perhaps a bogu '-'? See http://procps.sf.net/faq.html
Crifan 6880 0.0 0.0 5628 764 pts/0 S + grep -- color = auto nmbd
The explanations of smbd and nmbd are as follows:
Http://hi.baidu.com/chenyangxin/blog/item/9c388050681bfd738535248e.html
"We can see that the samba service will start two services at the same time. smbd is mainly used to manage shared directories, and nmbd is mainly used to parse NetBIOS names. In a Windows system, a host can be added to a group, so that each host must have a name, which is used to be marked online, not the host name of the machine, it is called the NetBIOS name. The nmbd process starts as the smbd process starts ."