Samba3.6.10 on Samsung GT-I9100 mobile

Source: Internet
Author: User

Question 1:Saminfo3_for_guest: unable to locate Guest account [Nobody]!

I guess it was caused by the absence of the nobody user, so it was good to add the nobody user to the passwd file. (Note: the/etc/passwd file here is not available in Android. I manually added the file, and the records in it are also manually added. How to add the file, re-mount the system partition to RW. For example, run the Mount-O remount, RW/dev/block/mmcblk0p9 system command. Of course, you can also directly execute ADB remount under ADB)

VI/etc/passwd Add the following two records (red ):

Root @ Android:/data/test/etc # Cat/etc/passwd
Root: 0: 0: Root:/data/test:/system/bin/sh
Nobody: 65534: 65534: Nobody:/nonexistent:/system/bin/sh
Root @ Android:/data/test/etc #

Question 2:You can see the shared directory, but it becomes stuck as soon as you enter it. the following error message is displayed in the smbd log:

[08:49:16. 335483, 0] smbd/VFS. C: 173 (vfs_init_custom)
Error probing VFS module 'fake _ perms': nt_status_unsuccessful
[08:49:16. 336495, 0] smbd/VFS. C: 315 (smbd_vfs_init)
Smbd_vfs_init: vfs_init_custom failed for fake_perms
[08:49:16. 337105, 0] smbd/service. C: 902 (make_connection_snum)
Vfs_init failed for service test
I saw "fake_perms" printing in the log. I thought this was the result of the smb. conf file I copied from the Internet. So I commented out, OK.

[Test]
# VFS objects = fake_perms
Comment = Android/mnt/sdcard
# Path =/mnt/sdcard
Path =/data/test
# Path =/etc
Force user = root
Read Only = No
Writable = Yes

The configuration file and compilation of Samba-3.6.10:

Echo samba_cv_cc_negative_enum_values = Yes> my. Cache
Echo "samba_cv_have_werror = yes"> my. Cache
Echo "samba_cv_have_werror_implicit_function_declaration"> my. Cache
Echo "samba_cv_cc_negative_enum_values = yes"> my. Cache

. /Configure -- prefix =/home/rebi/cross_tools/samba-3.6.10/soure3/_ install -- Host = arm-unknown-Linux-gnueabi-Cache-file = My. cache -- With-quotas = No -- With-sys-quotas = No -- enable-SWAT = No -- enable-smbtorture4 = No -- enable-cups = No -- enable-PIE = No -- enable- relro = No
-- Enable-Fam = No -- enable-avahi = No -- With-rootsbindir =/data/test -- With-statedir =/data/test/etc -- With-cachedir =/data/test/etc -- With-ncalrpcdir =/data/test/etc -- With-nmbdsocketdir =/data/test/etc -- With-logfilebase = /data/test/etc
-- With-privatedir =/data/test/etc -- With-swatdir =/data/test/etc -- with-lockdir =/data/test/etc -- With-piddir =/data/test/etc -- With-configdir =/data/test/etc ldflags = "-wl, -Dynamic-linker =/data/APP/ld-linux.so.3"

Note: I have specified all privatedir and piddir to the/data/test/etc directory. Therefore, you need to create this directory on your mobile phone.

After the compilation is successful, you do not need to make install. simply copy smbd, nmbd, smbpasswd, and testparm from the bin directory under sours3.

After it is uploaded to the mobile phone, run./smbpasswd-a root command to add a root user and set the password for it.

Considering that debugging requires repeated startup to kill smbd and nmbd, I first debug Samba. Sh with a script file:

#!/bin/shcase "$1" inrestart)killall -9 smbd nmbd 2>/dev/null./smbd./nmbd;;stop)killall -9 smbd nmbd;;start)./smbd./nmbd;;*)echo "invalid param: $1";;esac

When the script is used, it includes parameters. For example, SH Samba. Sh restart is used to restart the samba service.

The complete SMB. conf is as follows (because I have modified the path in the code, this file needs to be placed in the/data/test/etc directory). If you are not sure about this file after modification, You can execute it. /testparm to check the cause.

Root @ Android:/data/test/etc # Cat smb. conf
[Global]
Interfaces = 192.168.1.11/24
Workgroup = workgroup
Server String = Samba on Android
NetBIOS name = android
Remote announce = 255.255.255.255
Encrypt passwords = Yes
Security = user
# Security = Share
Restrict Anonymous = 1
Load printers = No
Printcap name =/dev/null
Disable SPOOLSS = Yes
Deadtime = 5
Delete readonly = Yes
Nt acl support = No
Inherit permissions = Yes
Socket Options = so_sndbuf = 16384 so_rcvbuf = 16384
[Test]
# VFS objects = fake_perms
Comment = Android/mnt/sdcard
# Path =/mnt/sdcard
Path =/data/test
# Path =/etc
Force user = root
Read Only = No
Writable = Yes
# Guest OK = No
Browseable = Yes

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.