SlideShare a Scribd company logo
1 of 11
SAMBA 4 - Tutorial de Instalacao no Debian
Instalandopacotes
# apt-getinstall linux-sourcelinux-headers-$(uname -r) build-essential sshvimopenvpn
libreadline-devgitbuild-essentiallibattr1-devlibblkid-devlibgnutls28-devautoconfpython-
dev python-dnspythonlibacl1-devgdbpkg-configlibpopt-devlibldap2-devdnsutilsacl attr
libbsd-devdocbook-xsl libcups2-devkrb5-user
SetandopermissõesespeciaisdoAD
$ sudovim/etc/fstab
/dev/sdb1 /home xfs user_xattr,acl,barrier=1 1 1
# mount-oremount,rw/home
Testandopermissoesespeciais
# touchtest.txt
# setfattr-nuser.test-vtesttest.txt
# setfattr-nsecurity.test-vtest2test.txt
# getfattr-dtest.txt
# getfattr-nsecurity.test-dtest.txt
Se estivertudocorreto,oscomandosacima retornaraoessasrespostas,respectivamente:
# file:test.txt
user.test="test"
# file:test.txt
security.test="test2"
Instalandoe sincronizandoserviçode timercomPUCPR
# apt-getinstall ntpdate
# ntpdate ntp.pucpr.br
Setandohostname
# vim/etc/hostname
samba4
Setandoresolvedores
# vim/etc/resolv.conf
domainshark.net
searchshark.net
nameserver192.168.0.250
nameserver189.4.0.157 189.4.0.152
Setandoip
# vim/etc/network/interfaces
# The primarynetworkinterface
iface eth0inetstatic
address192.168.0.250
netmask255.255.255.0
gateway192.168.0.1
dns-nameservers192.168.0.250 189.4.0.157
dns-searchshark.net
Configurandooarquivo/etc/hosts
# vim/etc/hosts
127.0.0.1 localhost
127.0.1.1 samba4.shark.net samba4
192.168.0.250 samba4.shark.net samba4
# The followinglinesare desirable forIPv6capable hosts
::1 localhostip6-localhostip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
# wgethttp://ftp.samba.org/pub/samba/samba-4.1.16.tar.gz
# tar xvzf samba-4.1.16.tar.gz
# cd samba-4.1.16
# ./configure --prefix=/opt/samba --enable-debug --enable-selftest
# make
# make install
Solucaotemporariaparaexportarpath’sdo SAMBA4 compiladono/opt/samba
# exportPATH=$PATH:/opt/samba/bin/
Solucaodefinitivaparaexportarpath’sdoSAMBA4 no/opt/samba
# vim/etc/profile ( cole aofinal doarquivo)
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/samba/bin:/opt/samba
/sbin"
# . /etc/profile
RebootdoSO
# init6
Subindooserviço
# /opt/samba/sbin/samba
Ou apenas
# samba( apósexportaras path’s)
# psaux | grepsamba
Criandoo DominioAD
# /opt/samba/bin/samba-tooldomainprovision
Ou apenas
# samba-tool domainprovision( aposexportaraspath’s )
# Exemplode configuracaopara/etc/krb5.conf
[logging]
default= FILE:/var/log/krb5libs.log
kdc = FILE:/var/log/krb5kdc.log
admin_server=FILE:/var/log/kadmind.log
[libdefaults]
default_realm=shark.net
dns_lookup_realm=false
dns_lookup_kdc= true
ticket_lifetime=24h
renew_lifetime =7d
forwardable =true
[realms]
SHARK.NET= {
kdc = samba4.shark.net # ( aqui pode sero ip doServidor)
admin_server= samba4.shark.net
}
[domain_realm]
.shark.net= samba4.shark.net
shark.net= samba4.shark.net
Sobe SAMBA 4
# samba
Testandoo smb.conf
# testparm
# /opt/samba/bin/smbclient//localhost/netlogon -UAdministrator%'SUA_SENHA'-c"ls"
Consultandoclient:
# /opt/samba/bin/smbclient –version
# /opt/samba/bin/smbclient -Llocalhost-U%
VerificandozonaprimariacriadapeloSAMBA 4
# samba-tool dnszonelist127.0.0.1 --auto-U Administrator--password=SUA_SENHA
Criandozonade DNSreverso
# samba-tool dnszonecreate 127.0.0.1 0.168.192.in-addr.arpa -U Administrator--
password=SUA_SENHA
Verificandoazonareversa
# samba-tool dnszonelist127.0.0.1 --reverse -UAdministrator --password=SUA_SENHA
# verificarusabilidade
#AdicionandooRoteadordarede ao DNS
# samba-tool dnsadd192.168.0.1 0.168.192.in-addr.arpa 1 PTR roteador.shark.net -U
Administrator--password=SUA_SENHA
Desabilitandoacomplexidade de senhas
# samba-tool domainpasswordsettingsshow
# samba-tool domainpasswordsettingsset --complexity=off --history-length=0--min-pwd-
length=0--min-pwd-age=0
Relendoconfiguracoes
# /opt/samba/bin/smbcontrol all reload-config
Revisandousuarios
# /opt/samba/bin/samba-tooluserlist
# /opt/samba/bin/samba-toolusersetpasswordEduardo.charquero
Testandotiket
# kinitAdministrator@shark.net
# klist
Testandoo dominiocomdig
# digshark.net
Consultandokerberose ldap:
# dig-t srv_kerberos._tcp.shark.net
# dig-t srv_ldap._tcp.shark.net
# host-t A rwindows8
SetandoSAMBA 4 na inicializaçãodoSO
# vim/etc/init.d/samba
#! /bin/bash
### BEGIN INIT INFO
# Provides: samba
# Required-Start: $network $local_fs$remote_fs
# Required-Stop: $network $local_fs$remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description:start Samba daemons
### END INIT INFO
#
# Start/stopsthe Samba daemon (samba).
# Adapted from the Samba 3 packages.
#
SAMBAPID=/opt/samba/var/run/samba.pid
# clear conflicting settingsfrom the environment
unset TMPDIR
# See if the daemon and the config file are there
test -x /opt/samba/sbin -a -r /opt/samba/etc/ || exit 0
. /lib/lsb/init-functions
case "$1" in
start)
log_daemon_msg "Starting Samba 4 daemon" "samba"
if ! start-stop-daemon --start --quiet --oknodo --exec /opt/samba/sbin/samba -- -D; then
log_end_msg 1
exit 1
fi
log_end_msg 0
;;
stop)
log_daemon_msg "Stopping Samba 4 daemon" "samba"
start-stop-daemon --stop --quiet --name samba $SAMBAPID
# Wait a little and remove stale PID file
sleep 1
if [ -f $SAMBAPID ] && ! ps h `cat $SAMBAPID` > /dev/null
then
# Stale PID file (samba was succesfully stopped),
# remove it (should be removed by samba itself IMHO.)
rm -f $SAMBAPID
fi
log_end_msg 0
;;
restart|force-reload)
$0 stop
sleep 1
$0 start
;;
*)
echo "Usage: /etc/init.d/samba {start|stop|restart|force-reload}"
exit 1
;;
esac
exit 0
Setandopermissão
# chmod+x /etc/init.d/samba
# update-rc.dsambadefaults
Criandoa pasta de perfismoveis
# mkdir/opt/samba/var/profiles
# chmod-R 1777 profiles
Criandoo Compartilhamento
# cd /home
# mkdir/Dados
# mkdir/Dados/Diretoria...Financeiro...Rh...Comercial...Publica...Tecnico...
Adicionandodiretóriosaosmb.conf
# vim/opt/samba/etc/smb.conf
# Global parameters
[global]
workgroup= shark
realm= samba4.shark.net
netbiosname = samba4
serverrole = active directorydomaincontroller
dns forwarder= 200.189.80.43
[netlogon]
path = /opt/samba/var/locks/sysvol/xirux.local/scripts
read only= No
[sysvol]
path = /opt/samba/var/locks/sysvol
read only= No
[profiles]
Path = /opt/samba/var/profiles
Readonly= no
[Dados]
path = /home/Dados
comment= CompartilhamentosdaRede
read only= No
[Diretoria]
path = /home/Dados/Diretoria
comment= Pasta Diretoria
read only= No
[Rh]
path = /home/Dados/Rh
comment= PastaRh
read only= No
[Financeiro]
path = /home/Dados/Financeiro
comment= PastaFinanceiro
read only= No
[Tecnico]
path = /home/Dados/Tecnico
comment= PastaTecnico
read only= No
[Comercial]
path = /home/Dados/Comercial
comment= PastaComercial
read only= No
[Publica]
path = /home/Dados/Publica
comment= PastaPublica
readonly= no
SetandopermissoesaosDiretorios
# chownroot:usersDados/ -R
# chmod770 /home/dados/ -R
# chownroot:users/opt/samba/var/profiles/ -R
# chmod770 /opt/samba/var/profiles
As demaisconfiguracoesrelativasacriacaode usuarios,gerenciamentode compartilhamentos
podeme devemserfeitospelasFerramentasde GerenciamentodoWindowsServer2008,
instaladosnoWindows7ou 8.
Os perfisMoveis;Basicamente,crieiumapastaem/opt/samba/profiles,apontei no
/opt/samba/etc/smb.conf e adicionei aoperfildousuárionoAD:
samba4profiles%USERNAME%
Eduardo Charquero
Tecnólogo em Redes de Computadores
Administrador de Sistemas Linux
Linux user & 529578
e-mail: eduardo.charquero@hotmail.com

More Related Content

What's hot

도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)
도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)
도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)Sam Kim
 
OSBConf 2015 | Backups with rdiff backup and rsnapshot by christoph mitasch &...
OSBConf 2015 | Backups with rdiff backup and rsnapshot by christoph mitasch &...OSBConf 2015 | Backups with rdiff backup and rsnapshot by christoph mitasch &...
OSBConf 2015 | Backups with rdiff backup and rsnapshot by christoph mitasch &...NETWAYS
 
agri inventory - nouka data collector / yaoya data convertor
agri inventory - nouka data collector / yaoya data convertoragri inventory - nouka data collector / yaoya data convertor
agri inventory - nouka data collector / yaoya data convertorToshiaki Baba
 
Make container without_docker_7
Make container without_docker_7Make container without_docker_7
Make container without_docker_7Sam Kim
 
Lecture 3 Perl & FreeBSD administration
Lecture 3 Perl & FreeBSD administrationLecture 3 Perl & FreeBSD administration
Lecture 3 Perl & FreeBSD administrationMohammed Farrag
 
3.1.c apend scripting, crond, atd
3.1.c apend   scripting, crond, atd3.1.c apend   scripting, crond, atd
3.1.c apend scripting, crond, atdAcácio Oliveira
 
Using cgroups in docker container
Using cgroups in docker containerUsing cgroups in docker container
Using cgroups in docker containerVinay Jindal
 
Ubuntu安装SVN总结
Ubuntu安装SVN总结Ubuntu安装SVN总结
Ubuntu安装SVN总结wensheng wei
 
Linux Capabilities - eng - v2.1.5, compact
Linux Capabilities - eng - v2.1.5, compactLinux Capabilities - eng - v2.1.5, compact
Linux Capabilities - eng - v2.1.5, compactAlessandro Selli
 
FreeBSD Jail Complete Example
FreeBSD Jail Complete ExampleFreeBSD Jail Complete Example
FreeBSD Jail Complete ExampleMohammed Farrag
 
2.1.using the shell
2.1.using the shell2.1.using the shell
2.1.using the shelldonv214
 
Really useful linux commands
Really useful linux commandsReally useful linux commands
Really useful linux commandsMichael J Geiser
 
Bundling Packages and Deploying Applications with RPM
Bundling Packages and Deploying Applications with RPMBundling Packages and Deploying Applications with RPM
Bundling Packages and Deploying Applications with RPMAlexander Shopov
 
MINCS - containers in the shell script (Eng. ver.)
MINCS - containers in the shell script (Eng. ver.)MINCS - containers in the shell script (Eng. ver.)
MINCS - containers in the shell script (Eng. ver.)Masami Hiramatsu
 

What's hot (20)

도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)
도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)
도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)
 
50 Most Frequently Used UNIX Linux Commands -hmftj
50 Most Frequently Used UNIX  Linux Commands -hmftj50 Most Frequently Used UNIX  Linux Commands -hmftj
50 Most Frequently Used UNIX Linux Commands -hmftj
 
OSBConf 2015 | Backups with rdiff backup and rsnapshot by christoph mitasch &...
OSBConf 2015 | Backups with rdiff backup and rsnapshot by christoph mitasch &...OSBConf 2015 | Backups with rdiff backup and rsnapshot by christoph mitasch &...
OSBConf 2015 | Backups with rdiff backup and rsnapshot by christoph mitasch &...
 
agri inventory - nouka data collector / yaoya data convertor
agri inventory - nouka data collector / yaoya data convertoragri inventory - nouka data collector / yaoya data convertor
agri inventory - nouka data collector / yaoya data convertor
 
Make container without_docker_7
Make container without_docker_7Make container without_docker_7
Make container without_docker_7
 
50 most frequently used unix
50 most frequently used unix50 most frequently used unix
50 most frequently used unix
 
Putting some "logic" in LVM.
Putting some "logic" in LVM.Putting some "logic" in LVM.
Putting some "logic" in LVM.
 
Lecture 3 Perl & FreeBSD administration
Lecture 3 Perl & FreeBSD administrationLecture 3 Perl & FreeBSD administration
Lecture 3 Perl & FreeBSD administration
 
3.1.c apend scripting, crond, atd
3.1.c apend   scripting, crond, atd3.1.c apend   scripting, crond, atd
3.1.c apend scripting, crond, atd
 
Using cgroups in docker container
Using cgroups in docker containerUsing cgroups in docker container
Using cgroups in docker container
 
Ubuntu安装SVN总结
Ubuntu安装SVN总结Ubuntu安装SVN总结
Ubuntu安装SVN总结
 
Linux Capabilities - eng - v2.1.5, compact
Linux Capabilities - eng - v2.1.5, compactLinux Capabilities - eng - v2.1.5, compact
Linux Capabilities - eng - v2.1.5, compact
 
Lec7
Lec7Lec7
Lec7
 
FreeBSD Jail Complete Example
FreeBSD Jail Complete ExampleFreeBSD Jail Complete Example
FreeBSD Jail Complete Example
 
2.1.using the shell
2.1.using the shell2.1.using the shell
2.1.using the shell
 
Really useful linux commands
Really useful linux commandsReally useful linux commands
Really useful linux commands
 
Solaris
SolarisSolaris
Solaris
 
Bundling Packages and Deploying Applications with RPM
Bundling Packages and Deploying Applications with RPMBundling Packages and Deploying Applications with RPM
Bundling Packages and Deploying Applications with RPM
 
MINCS - containers in the shell script (Eng. ver.)
MINCS - containers in the shell script (Eng. ver.)MINCS - containers in the shell script (Eng. ver.)
MINCS - containers in the shell script (Eng. ver.)
 
Linux Commands
Linux CommandsLinux Commands
Linux Commands
 

Similar to Samba 4 - debian instalacao

Install tomcat 5.5 in debian os and deploy war file
Install tomcat 5.5 in debian os and deploy war fileInstall tomcat 5.5 in debian os and deploy war file
Install tomcat 5.5 in debian os and deploy war fileNguyen Cao Hung
 
SANS @Night There's Gold in Them Thar Package Management Databases
SANS @Night There's Gold in Them Thar Package Management DatabasesSANS @Night There's Gold in Them Thar Package Management Databases
SANS @Night There's Gold in Them Thar Package Management DatabasesPhil Hagen
 
Piratte installation
Piratte installationPiratte installation
Piratte installationKampa Lavanya
 
Slug 2009 06 SELinux For Sysadmins
Slug 2009 06 SELinux For SysadminsSlug 2009 06 SELinux For Sysadmins
Slug 2009 06 SELinux For SysadminsPaulWay
 
NUMOSS 4th Week - Commandline Tutorial
NUMOSS 4th Week - Commandline TutorialNUMOSS 4th Week - Commandline Tutorial
NUMOSS 4th Week - Commandline TutorialGagah Arifianto
 
Install Archlinux in 10 Steps (Sort of) :)
Install Archlinux in 10 Steps (Sort of) :)Install Archlinux in 10 Steps (Sort of) :)
Install Archlinux in 10 Steps (Sort of) :)Sian Lerk Lau
 
Virtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + PuppetVirtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + PuppetOmar Reygaert
 
Slackware Demystified [SELF 2011]
Slackware Demystified [SELF 2011]Slackware Demystified [SELF 2011]
Slackware Demystified [SELF 2011]Vincent Batts
 
Introduction to linux day1
Introduction to linux day1Introduction to linux day1
Introduction to linux day1Gourav Varma
 
One-Liners to Rule Them All
One-Liners to Rule Them AllOne-Liners to Rule Them All
One-Liners to Rule Them Allegypt
 
Andresen 8 21 02
Andresen 8 21 02Andresen 8 21 02
Andresen 8 21 02FNian
 
Linux Troubleshooting
Linux TroubleshootingLinux Troubleshooting
Linux TroubleshootingKeith Wright
 
Supporting Debian machines for friends and family
Supporting Debian machines for friends and familySupporting Debian machines for friends and family
Supporting Debian machines for friends and familyFrancois Marier
 
Container Security
Container SecurityContainer Security
Container Securityamouat
 
Basic shell commands by Jeremy Sanders
Basic shell commands by Jeremy SandersBasic shell commands by Jeremy Sanders
Basic shell commands by Jeremy SandersDevanand Gehlot
 
Linux Du Jour
Linux Du JourLinux Du Jour
Linux Du Jourmwedgwood
 

Similar to Samba 4 - debian instalacao (20)

Install tomcat 5.5 in debian os and deploy war file
Install tomcat 5.5 in debian os and deploy war fileInstall tomcat 5.5 in debian os and deploy war file
Install tomcat 5.5 in debian os and deploy war file
 
SANS @Night There's Gold in Them Thar Package Management Databases
SANS @Night There's Gold in Them Thar Package Management DatabasesSANS @Night There's Gold in Them Thar Package Management Databases
SANS @Night There's Gold in Them Thar Package Management Databases
 
Piratte installation
Piratte installationPiratte installation
Piratte installation
 
Slug 2009 06 SELinux For Sysadmins
Slug 2009 06 SELinux For SysadminsSlug 2009 06 SELinux For Sysadmins
Slug 2009 06 SELinux For Sysadmins
 
Rpm Introduction
Rpm IntroductionRpm Introduction
Rpm Introduction
 
NUMOSS 4th Week - Commandline Tutorial
NUMOSS 4th Week - Commandline TutorialNUMOSS 4th Week - Commandline Tutorial
NUMOSS 4th Week - Commandline Tutorial
 
Install Archlinux in 10 Steps (Sort of) :)
Install Archlinux in 10 Steps (Sort of) :)Install Archlinux in 10 Steps (Sort of) :)
Install Archlinux in 10 Steps (Sort of) :)
 
Linux Command Line
Linux Command LineLinux Command Line
Linux Command Line
 
Virtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + PuppetVirtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + Puppet
 
Slackware Demystified [SELF 2011]
Slackware Demystified [SELF 2011]Slackware Demystified [SELF 2011]
Slackware Demystified [SELF 2011]
 
Introduction to linux day1
Introduction to linux day1Introduction to linux day1
Introduction to linux day1
 
Unix tips and tricks
Unix tips and tricksUnix tips and tricks
Unix tips and tricks
 
One-Liners to Rule Them All
One-Liners to Rule Them AllOne-Liners to Rule Them All
One-Liners to Rule Them All
 
Andresen 8 21 02
Andresen 8 21 02Andresen 8 21 02
Andresen 8 21 02
 
Linux Troubleshooting
Linux TroubleshootingLinux Troubleshooting
Linux Troubleshooting
 
Supporting Debian machines for friends and family
Supporting Debian machines for friends and familySupporting Debian machines for friends and family
Supporting Debian machines for friends and family
 
Container Security
Container SecurityContainer Security
Container Security
 
Basic shell commands by Jeremy Sanders
Basic shell commands by Jeremy SandersBasic shell commands by Jeremy Sanders
Basic shell commands by Jeremy Sanders
 
Centos config
Centos configCentos config
Centos config
 
Linux Du Jour
Linux Du JourLinux Du Jour
Linux Du Jour
 

Recently uploaded

Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 

Recently uploaded (20)

Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 

Samba 4 - debian instalacao

  • 1. SAMBA 4 - Tutorial de Instalacao no Debian Instalandopacotes # apt-getinstall linux-sourcelinux-headers-$(uname -r) build-essential sshvimopenvpn libreadline-devgitbuild-essentiallibattr1-devlibblkid-devlibgnutls28-devautoconfpython- dev python-dnspythonlibacl1-devgdbpkg-configlibpopt-devlibldap2-devdnsutilsacl attr libbsd-devdocbook-xsl libcups2-devkrb5-user SetandopermissõesespeciaisdoAD $ sudovim/etc/fstab /dev/sdb1 /home xfs user_xattr,acl,barrier=1 1 1 # mount-oremount,rw/home Testandopermissoesespeciais # touchtest.txt # setfattr-nuser.test-vtesttest.txt # setfattr-nsecurity.test-vtest2test.txt # getfattr-dtest.txt # getfattr-nsecurity.test-dtest.txt Se estivertudocorreto,oscomandosacima retornaraoessasrespostas,respectivamente: # file:test.txt user.test="test" # file:test.txt security.test="test2" Instalandoe sincronizandoserviçode timercomPUCPR # apt-getinstall ntpdate # ntpdate ntp.pucpr.br
  • 2. Setandohostname # vim/etc/hostname samba4 Setandoresolvedores # vim/etc/resolv.conf domainshark.net searchshark.net nameserver192.168.0.250 nameserver189.4.0.157 189.4.0.152 Setandoip # vim/etc/network/interfaces # The primarynetworkinterface iface eth0inetstatic address192.168.0.250 netmask255.255.255.0 gateway192.168.0.1 dns-nameservers192.168.0.250 189.4.0.157 dns-searchshark.net Configurandooarquivo/etc/hosts # vim/etc/hosts 127.0.0.1 localhost 127.0.1.1 samba4.shark.net samba4 192.168.0.250 samba4.shark.net samba4
  • 3. # The followinglinesare desirable forIPv6capable hosts ::1 localhostip6-localhostip6-loopback ff02::1 ip6-allnodes ff02::2 ip6-allrouters # wgethttp://ftp.samba.org/pub/samba/samba-4.1.16.tar.gz # tar xvzf samba-4.1.16.tar.gz # cd samba-4.1.16 # ./configure --prefix=/opt/samba --enable-debug --enable-selftest # make # make install Solucaotemporariaparaexportarpath’sdo SAMBA4 compiladono/opt/samba # exportPATH=$PATH:/opt/samba/bin/ Solucaodefinitivaparaexportarpath’sdoSAMBA4 no/opt/samba # vim/etc/profile ( cole aofinal doarquivo) PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/samba/bin:/opt/samba /sbin" # . /etc/profile RebootdoSO # init6 Subindooserviço # /opt/samba/sbin/samba Ou apenas # samba( apósexportaras path’s)
  • 4. # psaux | grepsamba Criandoo DominioAD # /opt/samba/bin/samba-tooldomainprovision Ou apenas # samba-tool domainprovision( aposexportaraspath’s ) # Exemplode configuracaopara/etc/krb5.conf [logging] default= FILE:/var/log/krb5libs.log kdc = FILE:/var/log/krb5kdc.log admin_server=FILE:/var/log/kadmind.log [libdefaults] default_realm=shark.net dns_lookup_realm=false dns_lookup_kdc= true ticket_lifetime=24h renew_lifetime =7d forwardable =true [realms] SHARK.NET= { kdc = samba4.shark.net # ( aqui pode sero ip doServidor) admin_server= samba4.shark.net }
  • 5. [domain_realm] .shark.net= samba4.shark.net shark.net= samba4.shark.net Sobe SAMBA 4 # samba Testandoo smb.conf # testparm # /opt/samba/bin/smbclient//localhost/netlogon -UAdministrator%'SUA_SENHA'-c"ls" Consultandoclient: # /opt/samba/bin/smbclient –version # /opt/samba/bin/smbclient -Llocalhost-U% VerificandozonaprimariacriadapeloSAMBA 4 # samba-tool dnszonelist127.0.0.1 --auto-U Administrator--password=SUA_SENHA Criandozonade DNSreverso # samba-tool dnszonecreate 127.0.0.1 0.168.192.in-addr.arpa -U Administrator-- password=SUA_SENHA Verificandoazonareversa # samba-tool dnszonelist127.0.0.1 --reverse -UAdministrator --password=SUA_SENHA # verificarusabilidade #AdicionandooRoteadordarede ao DNS # samba-tool dnsadd192.168.0.1 0.168.192.in-addr.arpa 1 PTR roteador.shark.net -U Administrator--password=SUA_SENHA Desabilitandoacomplexidade de senhas
  • 6. # samba-tool domainpasswordsettingsshow # samba-tool domainpasswordsettingsset --complexity=off --history-length=0--min-pwd- length=0--min-pwd-age=0 Relendoconfiguracoes # /opt/samba/bin/smbcontrol all reload-config Revisandousuarios # /opt/samba/bin/samba-tooluserlist # /opt/samba/bin/samba-toolusersetpasswordEduardo.charquero Testandotiket # kinitAdministrator@shark.net # klist Testandoo dominiocomdig # digshark.net Consultandokerberose ldap: # dig-t srv_kerberos._tcp.shark.net # dig-t srv_ldap._tcp.shark.net # host-t A rwindows8 SetandoSAMBA 4 na inicializaçãodoSO # vim/etc/init.d/samba #! /bin/bash ### BEGIN INIT INFO # Provides: samba
  • 7. # Required-Start: $network $local_fs$remote_fs # Required-Stop: $network $local_fs$remote_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description:start Samba daemons ### END INIT INFO # # Start/stopsthe Samba daemon (samba). # Adapted from the Samba 3 packages. # SAMBAPID=/opt/samba/var/run/samba.pid # clear conflicting settingsfrom the environment unset TMPDIR # See if the daemon and the config file are there test -x /opt/samba/sbin -a -r /opt/samba/etc/ || exit 0 . /lib/lsb/init-functions case "$1" in start) log_daemon_msg "Starting Samba 4 daemon" "samba" if ! start-stop-daemon --start --quiet --oknodo --exec /opt/samba/sbin/samba -- -D; then log_end_msg 1 exit 1 fi log_end_msg 0 ;; stop) log_daemon_msg "Stopping Samba 4 daemon" "samba"
  • 8. start-stop-daemon --stop --quiet --name samba $SAMBAPID # Wait a little and remove stale PID file sleep 1 if [ -f $SAMBAPID ] && ! ps h `cat $SAMBAPID` > /dev/null then # Stale PID file (samba was succesfully stopped), # remove it (should be removed by samba itself IMHO.) rm -f $SAMBAPID fi log_end_msg 0 ;; restart|force-reload) $0 stop sleep 1 $0 start ;; *) echo "Usage: /etc/init.d/samba {start|stop|restart|force-reload}" exit 1 ;; esac exit 0 Setandopermissão # chmod+x /etc/init.d/samba # update-rc.dsambadefaults Criandoa pasta de perfismoveis # mkdir/opt/samba/var/profiles
  • 9. # chmod-R 1777 profiles Criandoo Compartilhamento # cd /home # mkdir/Dados # mkdir/Dados/Diretoria...Financeiro...Rh...Comercial...Publica...Tecnico... Adicionandodiretóriosaosmb.conf # vim/opt/samba/etc/smb.conf # Global parameters [global] workgroup= shark realm= samba4.shark.net netbiosname = samba4 serverrole = active directorydomaincontroller dns forwarder= 200.189.80.43 [netlogon] path = /opt/samba/var/locks/sysvol/xirux.local/scripts read only= No [sysvol] path = /opt/samba/var/locks/sysvol read only= No [profiles] Path = /opt/samba/var/profiles
  • 10. Readonly= no [Dados] path = /home/Dados comment= CompartilhamentosdaRede read only= No [Diretoria] path = /home/Dados/Diretoria comment= Pasta Diretoria read only= No [Rh] path = /home/Dados/Rh comment= PastaRh read only= No [Financeiro] path = /home/Dados/Financeiro comment= PastaFinanceiro read only= No [Tecnico] path = /home/Dados/Tecnico comment= PastaTecnico read only= No
  • 11. [Comercial] path = /home/Dados/Comercial comment= PastaComercial read only= No [Publica] path = /home/Dados/Publica comment= PastaPublica readonly= no SetandopermissoesaosDiretorios # chownroot:usersDados/ -R # chmod770 /home/dados/ -R # chownroot:users/opt/samba/var/profiles/ -R # chmod770 /opt/samba/var/profiles As demaisconfiguracoesrelativasacriacaode usuarios,gerenciamentode compartilhamentos podeme devemserfeitospelasFerramentasde GerenciamentodoWindowsServer2008, instaladosnoWindows7ou 8. Os perfisMoveis;Basicamente,crieiumapastaem/opt/samba/profiles,apontei no /opt/samba/etc/smb.conf e adicionei aoperfildousuárionoAD: samba4profiles%USERNAME% Eduardo Charquero Tecnólogo em Redes de Computadores Administrador de Sistemas Linux Linux user & 529578 e-mail: eduardo.charquero@hotmail.com