Hangaia he Tūmau Samba Maama me te Rorohiko Rauemi Rawa

He pono he maha nga tuhinga e pa ana ki runga Samba ki te hanga maamaa pakari ranei Tūmau Penapena, engari he maha nga wa kaore ratou e arahi tika ki a maatau ki nga waahanga whaihua me a raatau whakamaarama me nga ahuatanga whakamahi tuuturu, ara, he maha nga korero ka kitea engari kaore i taatai ​​ki nga hiahia o te nuinga, me nga taangata hou, o nga tiimata ranei. te rohe.

lpi Heoi, ka waiho e au taku wheako ki tenei pou mo tenei kaupapa:

Ko te tuatahi ka waiho e ahau ki a koe nga ahuatanga hangarau o te rorohiko rauemi-iti e whakamahia ana:

pūmārō:

pūmanawa:

Na ka anga ahau ki te whakauru me te whirihora i te kohinga samba ki te Kaitoha o taku kotiro iti Whatunga LAN e whai ake nei:

1.- Whakauruhia te samba me te whakahau whakahau:

aptitude install samba samba-common smbclient samba-doc smbfs winbind

2.- I hoki whakamuri ahau ki te whirihora samba taunoa kei roto i te konae whirihoranga smb.conf me te whakahau whakahau:

cp /etc/samba/smb.conf /etc/samba/smb.conf.bck
  1. Na ka whakatika i te konae whirihoranga me te etita o taku manakohanga me te whakahau whakahau:
vi /etc/samba/smb.conf

Mahue ana penei:


#======================= Global Settings =======================

[global]

## Browsing/Identification ###

workgroup = WORKGROUP
dns proxy = no
; wins support = no
; wins server = w.x.y.z
; server string = %h server
; name resolve order = lmhosts host wins bcast

#### Networking ####

; interfaces = 127.0.0.0/8 eth0
; bind interfaces only = yes

#### Debugging/Accounting ####

log file = /var/log/samba/log.%m
max log size = 1000
syslog = 0
panic action = /usr/share/samba/panic-action %d
; syslog only = no

####### Authentication #######

server role = standalone server
passdb backend = tdbsam
obey pam restrictions = yes
unix password sync = yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
pam password change = yes
map to guest = bad user
security = user
username map = /etc/samba/smbusers
; encrypt passwords = true

########## Domains ###########

; server role = primary classic domain controller
; server role = backup domain controller
; server role = domain logons
; logon path = \\%N\profiles\%U
; logon path = \\%N\%U\profile
; logon drive = H:
; logon home = \\%N\%U
; logon script = logon.cmd
; add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u
; add machine script  = /usr/sbin/useradd -g machines -c "%u machine account" -d /var/lib/samba -s /bin/false %u
; add group script = /usr/sbin/addgroup --force-badname %g
; domain logons = yes

############ Misc ############

usershare allow guests = yes
; usershare max shares = 100
; include = /home/samba/etc/smb.conf.%m
; domain master = auto
; idmap uid = 10000-20000
; idmap gid = 10000-20000
; template shell = /bin/bash
; winbind enum groups = yes
; winbind enum users = yes
; usershare max shares = 100
; SO_RCVBUF=8192 SO_SNDBUF=8192
; socket options = TCP_NODELAY
; message command = /bin/sh -c '/usr/bin/linpopup "%f" "%m" %s; rm %s' &


#======================= Share Definitions =======================

[homes]

comment = Home Directories
browseable = no
read only = yes
create mask = 0700
directory mask = 0700
valid users = %S

; [netlogon]

; comment = Network Logon Service
; path = /home/samba/netlogon
; guest ok = yes
; read only = yes

; [profiles]

; comment = Users profiles
; path = /home/samba/profiles
; guest ok = no
; browseable = no
; create mask = 0600
; directory mask = 0700

[printers]

comment = All Printers
browseable = no
path = /var/spool/samba
printable = yes
guest ok = no
read only = yes
create mask = 0700

[print$]

comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
read only = yes
guest ok = no
; write list = root, @lpadmin

; [cdrom]
; comment = Samba server's CD-ROM
; read only = yes
; locking = no
; path = /cdrom
; guest ok = yes
; /dev/scd0   /cdrom  iso9660 defaults,noauto,ro,user   0 0
; preexec = /bin/mount /cdrom
; postexec = /bin/umount /cdrom

# EJEMPLO DE RECURSO COMPARTIDO

[RECURSO_COMPARTIDO]

comment = Servidor Disco Duro 500 GB
path = /media/usuario-sysadmin/RESPALDO
writeable = yes
browseable = yes
public = yes
valid users = usuario_samba
create mask = 0755
directory mask = 0755
guest ok = no
; read only = no
; write list = usuario_samba
; force group = usuario_samba
; hide dot files = yes
; guest only = yes
; guest account = nobody
; delete veto files = yes
; veto files = /*.exe/*.com/*.dll/*.mp3/*.avi/*.mkv/*.msi/*.mpg/*.wmv/*.wma

Ka rite ki taku i korero atu ki a koe, i runga i te Ipurangi he maha nga korero mo samba a ko nga waahanga katoa me whirihora i roto i te konae smb.conf, ehara ko te hiahia o tenei whakaputanga. Heoi, ka waiho e au enei hononga iti nei mo tenei mea:

Katahi ahau ka anga ki te hanga i te samba kaiwhakamahi "samba_user" Tuhinga o mua Tūmau Samba, i whakamahia e ahau i mua whakahaere (whakahaere) nga rauemi kua tohaina mai i etahi atu rorohiko a taku GNU / Linux me MS Matapihi.  Mo tenei keehi kaore au e mahi ki te tohatoha mahi Kōpaki engari rawa taku Kōpae Hard Tuhinga o mua 500 GB. Na reira, me kii e au kia eke tenei kopae i te wa ka tiimata te kaiwhakarato, ahakoa kaore i te utaina te atanga whakairoiro, no reira ka haere tonu ahau ki te whakahaere i nga tikanga e whai ake nei:

Te whakaeke pumau i te Hard Drive 500GB i roto Pūnaha Mahi Tūmau

a) Whakamana (I tuhia e au) nga tohu whakapuru me te kōpaki o te rohe kei hea taku Pūnaha Mahi i eke aunoatia te 500GB Hard Drive. Ki te kore, ka taea e au te hanga kōpaki hei whakanoho i nga rauemi o te takiwa hei tohatoha, me te whakahau whakahau: mkdir -p / kua tohua_path / kua tohua_fold ka hoatu whakaaetanga ma te kaiwhakamahi ki a ia i runga i taku kaiwhakamahi matua o te Kaituku i huaina "Kaiwhakamahi-sysadmin".

b) Whakatika i te konae fstab me te ota whakahau "Nano / etc / fstab" me te whakauru i te raina huihuinga e whai ake nei:

/ dev / sdb1 / pāpāho / kaiwhakamahi-sysadmin / BACKUP / ntfs-3g rw, user_id = 1000, group_id = 1000

Tuhipoka: Whakamahia "Ntfs-3g" mai i te mea kua whakahōputuhia taku kōpae ki roto NTFS. Ka taea e koe te taapiri kaore ranei i te waahanga auto o te raina huihuinga i te fstab, i runga i o whakaritenga me o hiahia ranei. Mo au tonu, na tenei kowhiringa i kore ai ahau e tuuru (tauwehe) i te waa e whakapiri ana i te rauemi i te tiimatanga Pūnaha Mahi. Ka taea e koe te whakaara ano i te Kaiwhakarato ki te manatoko i te whakaurutanga aunoa o te Hard Drive ka whakamatautau ranei ma te whakamahi i te whakahau whakahau "Maunga -a" ki te whakamatau i te tohu Maunga. Mena he pai nga mea katoa, whakaara ano ki te whakamatautau ano i te Maunga mai i te tiimatanga. Ka taea te whirihora i tenei raina ma te maha o nga huarahi me nga taipitopito taapiri engari ka waiho ma te rangahau whaiaro, na te mea ehara ko te kaupapa o te whakaputanga. Mo etahi atu korero mo nga whiringa fstab, paatohia i konei.

I muri i tenei ka haere tonu ahau ki te hanga i te kaiwhakamahi rohe He aha taku e whakamahi ai samba ki te whakahaere mamao i aku hea. Ka taea tenei ma nga huarahi e rua:

1.- Taketake:

1.1) Waihangahia te kaiwhakamahi rohe hei whakahaere i te samba:

adduser kaiwhakamahi_samba

2.- Arā Atu Anō:

2.1) Hangaia te kopere kaainga a te kaiwhakamahi kaainga hei whakahaere i te samba:

mkdir / tohua_path / samba_user

2.2) Hangaia he roopu kaiwhakamahi samba:

groupadd kaiwhakamahi_group

2.2) Hangaia he whakaahua kaiwhakamahi samba:

kaiwhakamahiadd -g kaiwhakamahi_samba -d /igned_path / samba_user -c "Kōpaki Kaainga a te Kaiwhakamahi" -s / bin / kaiwhakamahi_group teka

Muri iho, a, i muri i te whakauru o te samba me te whirihora, te whakahoaho me te eke i te rauemi toha, i hangaia te kaiwhakamahi o te rohe, me matua:

Taapirihia te Kaiwhakamahi o te rohe al Tūmau Samba (Ratonga) whakauruhia me te tohu whakahau:

kaitautoko kaiwhakamahi_samba sambashare

Hangaia te kupuhipa whakauru he aha tana Kaiwhakamahi rohe i Samba me te whakahau whakahau:

smbpasswd -a kaiwhakamahi_samba

Tīmatahia te Ratonga Samba:

a) utaina te samba ratonga

b) ratonga smbd ka tiimata ano

c) ratonga nmbd timata ano

Katahi ano ta tatou tirohia te urunga mai i te rorohiko i te whatunga ki te waahanga. Mo tenei me maatau whakatuwheratia he kaihurihuri konae, tirohia te taiao whatunga, tirohia te waahanga mai i te kaituku. Heoi, kia kite koe i te waatea ma te tauranga, ka taea e koe te whakamahi i nga whakahau whakahau e whai ake nei, ma te mohio kaore ranei e mohio ki te IP, ki te ingoa ranei o te Kaitoha Samba:

1) smbclient – ​​rārangi = 192.168.XX

2) smbclient –list = 192.168.XX –user = samba_user

3) nbtscan 192.168.0.0/24

4) nmblookup samba_server_name

Ana ki te uru atu ki te hea mai i te Rorohiko i runga i te whatunga, whakatuwherahia tetahi kaitoro paetukutuku, tirohia te taiao whatunga, ka mahi paarua taarua i te waahanga mai i te tūmau, i roto i whakauruhia nga raraunga whakauru (Kaiwhakamahi / Kupuhipa / Rohe), hoatu ranei te huarahi tika ki te whakatakotoranga e whai ake nei: smb: //192.168.xx/SHARED_RESOURCE. Hei hono ma te taatai, whakahaerehia te whakahau e whai ake nei: smbclient –user = samba_user //192.168.xx/SHARED_RESOURCE

Hei whakamutunga, ana mena e tika ana, ka taea e koe te whirihora kua utaina aunoa tenei rauemi tiritiri, ki o taputapu whatunga ma te whakamahi i nga tikanga e whai ake nei:

a) Hangaia he kōpaki a rohe te wahi e eke ai te rauemi toha, me te whakahau whakahau:

mkdir -p / kua tohua_path / kua tohua_fold

b) Whakatika i te konae fstab me te ota whakahau "Nano / etc / fstab" me te whakauru i te raina huihuinga e whai ake nei:

//192.168.XX/SHARED_RESOURCE/ / designed_path /igned_folder cifs kaiwhakamahi, rw, ingoa kaiwhakamahi = samba_user, kupuhipa = samba_user_password, gid = 100 ?, Uid = 100 ?, Iocharset = utf8, dir_mode = 0755, file_mode = 0755 0 2

Tuhipoka: Whakamahia "Cifs" i te mea koinei te kawa samba hou e hono ana te samba ki te rauemi whatunga, i etahi waa ka hiahia koe ki te whakamahi «smb » Tuhinga o mua «cifs ». Te momo whakaaetanga kua tohaina ki dir_aratau y aratau_kōnae ka whakawhirinaki atu ki taau e tohu nei me / te kaiwhakamahi ranei o te kōpaki tiritiri e hiahia ana, ahakoa ko te mea pai me orite ki nga mea kua tohua ki te konae smb.conf mo taua rauemi tohaina. Me nga uara e pa ana ki te id y uid Me tika ana, ara, ma te kaiwhakamahi e whakapiki te rauemi ki te rorohiko mamao. Hei taapiri ka taea e koe te whakauru kaore ranei i te waahanga auto o te raina huihuinga i te fstab, i runga i o whakaritenga me o hiahia ranei. Mo au tonu, na tenei kowhiringa i kore ai ahau e tuuru (tauwehe) i te waa e whakapiri ana i te rauemi i te tiimatanga Pūnaha Mahi. Ka taea e koe te whakaara ano i te Kaiwhakarato ki te manatoko i te whakaurutanga aunoa o te Hard Drive ka whakamatautau ranei ma te whakamahi i te whakahau whakahau "Maunga -a" ki te whakamatau i te tohu Maunga. Mena he pai nga mea katoa, whakaara ano ki te whakamatautau ano i te Maunga mai i te tiimatanga. Ka taea te whirihora i tenei raina ma te maha o nga huarahi me nga taipitopito taapiri engari ka waiho ma te rangahau whaiaro, na te mea ehara ko te kaupapa o te whakaputanga. Mo etahi atu korero mo nga whiringa fstab, paatohia i konei.

Ana, ko te tumanako ka pai ki a koe tenei pou me aku hikoi me aku taunakitanga mo tera kaupapa.


Ko nga korero o te tuhinga e piri ana ki o maatau kaupapa o matatika whakatika. Ki te ripoata i tetahi paatene paato Here.

3 korero, waiho maau

Waiho to korero

Ka kore e whakaputaina tō wāhitau īmēra.

*

*

  1. He kawenga mo nga raraunga: Miguel Ángel Gatón
  2. Te kaupapa o te raraunga: Whakahaerehia te SPAM, te whakahaere korero.
  3. Ture: To whakaae
  4. Whakawhitinga korero: Kaore nga korero e tukuna ki nga taha tuatoru engari ma te ture herenga.
  5. Rokiroki raraunga: Paetukutuku e whakahaerehia ana e Occentus Networks (EU)
  6. Tika: I nga wa katoa ka taea e koe te whakaiti, te whakaora me te muku i o korero.

  1.   Chiwy ka mea

    He tino ngahau.

    Ana mo te kaituku mēra maamaa ...?

    Mauruuru.

  2.   Ingarangi Jose Albert ka mea

    Ka ngana ahau ki te mahi kotahi!

  3.   Oscar Silva ka mea

    Aroha, he mea tika kia taapirihia nga korero iti mo te hononga mai i nga rorohiko Matapihi ..., mena he tuto pai.

    Kia ora 🙂