Setup Samba Daemon from Source Code
Source tarball:
https://download.samba.org/pub/samba/samba-3.0.37.tar.gz
Build and Installation
./autogen.sh && ./configure && make && make install
Configure
After installation, you will find samba files in/usr/local/samba .
A simple example configuration file:
[global]
workgroup = MYGROUP
server string = Samba Server %v
security = user
log file = /var/log/samba/%m.log
passdb backend = smbpasswd
smb passwd file = /etc/samba/smbpasswd
[root]
path = /
valid users = root
writeable = yes
[public]
path = /tmp
guest ok = yes
read only = yes
Add samba user
Note: a samba user must be a system user first, (adduser/useradd system utilities). Note: make sure smbpasswd file exists in/etc/samba/smbpasswd, if not, touch it first. Note: make sure smb.conf file exists in/usr/local/samba/lib/smb.conf, if not, configure it as above;
as an example, add root to samba’s smbpasswd file;
#!/bin/bash
/usr/local/samba/bin/smbpasswd -a root
Enter password:
balabala....
Retry password:
balabala....
Added root as samba user.
Check configuration
#!/bin/bash
/usr/local/samba/bin/testparm
Startup
#!/bin/bash
/usr/local/samba/sbin/smbd -D
/usr/local/samba/sbin/nmbd -D
pgrep -x nmbd && pgrep -x smbd
echo "Done"
it is also available to specify a smb.conf for smbd & nmbd with -s option;
Test with smbclient
list
#!/bin/bash
/usr/local/samba/bin/smbclient -L //127.0.0.1/ -U root
Enter Password:
Domain=[HARRY-VIRTUALBOX] OS=[Unix] Server=[Samba 3.0.37]
Sharename Type Comment
--------- ---- -------
root Disk
public Disk
IPC$ IPC IPC Service (Samba Server 3.0.37)
Domain=[HARRY-VIRTUALBOX] OS=[Unix] Server=[Samba 3.0.37]
Server Comment
--------- -------
Workgroup Master
--------- -------
MYGROUP HARRY-VIRTUALBOX
WORKGROUP HARRYBOT
use it
#!/bin/bash
/usr/loca/samba/bin/smbclient //127.0.0.1/root -U root
Password:.....
Domain=[HARRY-VIRTUALBOX] OS=[Unix] Server=[Samba 3.0.37]
smb: \> ls
. D 0 Wed Dec 2 10:52:00 2015
.. D 0 Wed Dec 2 10:52:00 2015
mnt D 0 Mon Oct 19 17:14:38 2015
proc DR 0 Fri Feb 12 16:33:13 2016
media D 0 Wed Oct 21 23:49:12 2015
etc D 0 Sat Feb 13 16:06:17 2016
home D 0 Fri Feb 12 22:46:27 2016
run D 0 Sat Feb 13 15:18:23 2016
root D 0 Sat Feb 13 15:59:06 2016
opt D 0 Wed Oct 21 23:49:12 2015
cdrom D 0 Wed Dec 2 10:22:38 2015
srv D 0 Wed Oct 21 23:49:12 2015
lib64 D 0 Wed Oct 21 23:49:20 2015
usr D 0 Wed Jan 13 14:14:03 2016
vmlinuz 6797696 Wed Dec 2 10:21:56 2015
var D 0 Tue Dec 8 15:46:27 2015
lost+found D 0 Wed Dec 2 10:18:54 2015
tmp D 0 Sat Feb 13 16:18:12 2016
initrd.img 33669308 Wed Dec 2 10:52:58 2015
sys DR 0 Fri Feb 12 16:33:08 2016
boot D 0 Wed Dec 2 10:52:58 2015
bin D 0 Wed Dec 2 10:52:39 2015
sbin D 0 Fri Feb 12 22:36:20 2016
lib D 0 Fri Dec 18 22:35:25 2015
dev D 0 Sat Feb 13 03:02:07 2016
39433 blocks of size 1048576. 28119 blocks available
smb: \>
access from windows 7
net use x: \\192.168.56.101\root /user:root /persistent:yes
Enter password: ....
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Rsat İle Samba Üzerindeki Windows GPO'larının YönetimiLinuxa kurulan bir Samba DC(Etki alanı yöneticisi) yi yönetmek için 터미널(komut ekranı) kullanmak zorunda değiliz. Domaine...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.