Mainos / Advertisement:

Ero sivun ”Sambadc” versioiden välillä

Kohteesta Taisto
Siirry navigaatioon Siirry hakuun
 
(13 välissä olevaa versiota 2 käyttäjän tekeminä ei näytetä)
Rivi 1: Rivi 1:
{{#allow-groups:sysop|autoconfirmed}}
+
{{#allow-groups:user}}
 +
 
 +
Huom. 4.1.16 versiolla pukkaa erroria mulla.. asensin 4.1.3 niin vähän paremmin menee
 +
== Asennus ==
  
 
  apt-get install build-essential libacl1-dev libattr1-dev libblkid-dev libgnutls-dev libreadline-dev python-dev libpam0g-dev python-dnspython gdb pkg-config libpopt-dev libldap2-dev dnsutils libbsd-dev attr krb5-user docbook-xsl libcups2-dev acl
 
  apt-get install build-essential libacl1-dev libattr1-dev libblkid-dev libgnutls-dev libreadline-dev python-dev libpam0g-dev python-dnspython gdb pkg-config libpopt-dev libldap2-dev dnsutils libbsd-dev attr krb5-user docbook-xsl libcups2-dev acl
Rivi 23: Rivi 26:
 
  Version 4.1.16
 
  Version 4.1.16
  
 +
== Konfigurointi ==
 +
 +
wget -o /dev/null http://www.heikkiniemi.fi/sites/default/files/samba4.txt
 +
mv samba4.txt /etc/init.d/samba4
 +
chmod a+x /etc/init.d/samba4
 +
update-rc.d samba4 defaults
 +
 +
 +
Luodaan toimialue nimeltään JOHANNES ja järjestelmävalvojan salasanana Qwerty1.
  
 
  samba-tool domain provision --domain=JOHANNES --adminpass='Qwerty123' --function-level=2008_R2 --use-xattrs=yes --use-rfc2307 --realm=JOHANNES.LOCAL
 
  samba-tool domain provision --domain=JOHANNES --adminpass='Qwerty123' --function-level=2008_R2 --use-xattrs=yes --use-rfc2307 --realm=JOHANNES.LOCAL
  
 
  samba -i -M single -d2  
 
  samba -i -M single -d2  
 +
 +
Käynnistä Samba uudelleen
  
 
  service samba4 restart
 
  service samba4 restart
  
 +
Luodaan uusi käyttäjä haapajo, jonka tulee vaihtaa salasana seuraavalla kirjautumisen kerralla. Kotikansion polku on /home.johannes.local/haapajo
  
 
  samba-tool user add haapajo --must-change-at-next-login --surname=Johannes --given-name=Haapa --uid-number=5000 --gid-number=5000 --home-directory=/home/johannes.local/haapajo --login-shell=/bin/bash
 
  samba-tool user add haapajo --must-change-at-next-login --surname=Johannes --given-name=Haapa --uid-number=5000 --gid-number=5000 --home-directory=/home/johannes.local/haapajo --login-shell=/bin/bash
 +
 +
 +
 +
 +
http://www.golinuxhub.com/2013/06/samba-41-as-active-directory.html
 +
 +
 +
#!/bin/bash
 +
aptitude -y install build-essential libacl1-dev libattr1-dev libblkid-dev libgnutls-dev libreadline-dev python-dev libpam0g-dev python-dnspython gdb pkg-config libpopt-dev libldap2-dev dnsutils libbsd-dev attr krb5-user docbook-xsl libcups2-dev acl
 +
aptitude -y install git build-essential python-dev libacl1-dev libldap2-dev libctdb-dev libkrb5-dev libfam-dev dmapi-dev libpam-dev libavahi-common-  dev libavahi-client-dev libcups2-dev dnsutils
 +
wget https://www.samba.org/samba/ftp/stable/samba-4.1.16.tar.gz
 +
gunzip samba-4.1.16.tar.gz
 +
tar -xvf samba-4.1.16.tar
 +
mv samba-4.1.16 /usr/local/samba
 +
cd /usr/local/samba
 +
./configure
 +
make
 +
make install
 +
echo 'export PATH=$PATH:/usr/local/samba/bin:/usr/local/samba/sbin' >> .bashrc
 +
tail -n1 .bashrc
 +
export PATH=$PATH:/usr/local/samba/bin:/usr/local/samba/sbin
 +
source .bashrc
 +
samba -V
 +
echo '#! /bin/sh
 +
### BEGIN INIT INFO
 +
# Provides:          samba4
 +
# 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/stops the Samba daemon (samba).
 +
# Adapted from the Samba 3 packages.
 +
#
 +
PIDDIR=/usr/local/samba/var/run
 +
SAMBAPID=$PIDDIR/samba.pid
 +
# clear conflicting settings from the environment
 +
unset TMPDIR
 +
# See if the daemon and the config file are there
 +
test -x /usr/local/samba/sbin/samba -a -r /usr/local/samba/etc/smb.conf || exit 0
 +
. /lib/lsb/init-functions
 +
case "$1" in
 +
        start)
 +
                log_daemon_msg "Starting Samba 4 daemon" "samba"
 +
                # Make sure we have our PIDDIR, even if it's on a tmpfs
 +
                install -o root -g root -m 755 -d $PIDDIR
 +
                if ! start-stop-daemon --start --quiet --oknodo --exec /usr/local/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' > /etc/init.d/samba4
 +
chmod a+x /etc/init.d/samba4
 +
update-rc.d samba4 defaults
 +
echo '
 +
search testaus.ebin.local
 +
nameserver 192.168.1.1
 +
' > /etc/resolv.conf
 +
samba-tool domain provision --domain=EBIN --adminpass='Qwerty1' --function-level=2008_R2 --use-xattrs=yes --use-rfc2307 --realm=EBIN.LOCAL
 +
service samba4 restart
 +
 +
 +
 +
 +
 +
== Ubuntu serveri ==
 +
 +
Ubuntu serverillä samba dc ylös lykkiminen on super helppoa. Itse käytin 14.04 LTS
 +
aptitude install acl
 +
aptitude install samba krb5-user smbclient
 +
 +
sitten sambatoolilla domain provision vaan :)
 +
 +
# Global parameters
 +
[global]
 +
        workgroup = TESTI
 +
        realm = testi.local
 +
        netbios name = UBUNTUSRV
 +
        server role = active directory domain controller
 +
        dns forwarder = 8.8.8.8
 +
        allow dns updates = nonsecure and secure
 +
[netlogon]
 +
        path = /var/lib/samba/sysvol/testi.local/scripts
 +
        read only = No
 +
 +
[sysvol]
 +
        path = /var/lib/samba/sysvol
 +
        read only = No
 +
 +
 +
  18  samba-tool domain level raise --domain-level=2008
 +
  19  samba-tool domain level raise --forest-level=2008
 +
 +
[libdefaults]
 +
        default_realm = TESTI.LOCAL
 +
[realms]
 +
        TESTI.LOCAL = {
 +
                kdc = ubuntusrv
 +
                admin_server = ubuntusrv
 +
        }
 +
 +
127.0.0.1      localhost
 +
127.0.1.1      ubuntusrv.testi.local  ubuntusrv
 +
192.168.1.100  ubuntusrv.testi.local  ubuntusrv

Nykyinen versio 11. helmikuuta 2015 kello 22.06

{{#allow-groups:user}}

Huom. 4.1.16 versiolla pukkaa erroria mulla.. asensin 4.1.3 niin vähän paremmin menee

Asennus

apt-get install build-essential libacl1-dev libattr1-dev libblkid-dev libgnutls-dev libreadline-dev python-dev libpam0g-dev python-dnspython gdb pkg-config libpopt-dev libldap2-dev dnsutils libbsd-dev attr krb5-user docbook-xsl libcups2-dev acl
aptitude install git build-essential python-dev libacl1-dev libldap2-dev libctdb-dev libkrb5-dev libfam-dev dmapi-dev libpam-dev libavahi-common-dev libavahi-client-dev libcups2-dev dnsutils


wget https://www.samba.org/samba/ftp/stable/samba-4.1.16.tar.gz
gunzip samba-4.1.16.tar.gz
tar -xvf samba-4.1.16.tar
mv samba-4.1.16 /usr/local/samba
cd /usr/local/samba
./configure
make
make install


echo 'export PATH=$PATH:/usr/local/samba/bin:/usr/local/samba/sbin' >> .bashrc 
tail -n1 .bashrc
export PATH=$PATH:/usr/local/samba/bin:/usr/local/samba/sbin
source .bashrc 
root@sambadc:/usr/local/samba# samba -V
Version 4.1.16

Konfigurointi

wget -o /dev/null http://www.heikkiniemi.fi/sites/default/files/samba4.txt
mv samba4.txt /etc/init.d/samba4
chmod a+x /etc/init.d/samba4 
update-rc.d samba4 defaults


Luodaan toimialue nimeltään JOHANNES ja järjestelmävalvojan salasanana Qwerty1.

samba-tool domain provision --domain=JOHANNES --adminpass='Qwerty123' --function-level=2008_R2 --use-xattrs=yes --use-rfc2307 --realm=JOHANNES.LOCAL
samba -i -M single -d2 

Käynnistä Samba uudelleen

service samba4 restart

Luodaan uusi käyttäjä haapajo, jonka tulee vaihtaa salasana seuraavalla kirjautumisen kerralla. Kotikansion polku on /home.johannes.local/haapajo

samba-tool user add haapajo --must-change-at-next-login --surname=Johannes --given-name=Haapa --uid-number=5000 --gid-number=5000 --home-directory=/home/johannes.local/haapajo --login-shell=/bin/bash



http://www.golinuxhub.com/2013/06/samba-41-as-active-directory.html


#!/bin/bash
aptitude -y install build-essential libacl1-dev libattr1-dev libblkid-dev libgnutls-dev libreadline-dev python-dev libpam0g-dev python-dnspython gdb pkg-config libpopt-dev libldap2-dev dnsutils libbsd-dev attr krb5-user docbook-xsl libcups2-dev acl
aptitude -y install git build-essential python-dev libacl1-dev libldap2-dev libctdb-dev libkrb5-dev libfam-dev dmapi-dev libpam-dev libavahi-common-  dev libavahi-client-dev libcups2-dev dnsutils
wget https://www.samba.org/samba/ftp/stable/samba-4.1.16.tar.gz
gunzip samba-4.1.16.tar.gz
tar -xvf samba-4.1.16.tar
mv samba-4.1.16 /usr/local/samba
cd /usr/local/samba
./configure
make
make install
echo 'export PATH=$PATH:/usr/local/samba/bin:/usr/local/samba/sbin' >> .bashrc 
tail -n1 .bashrc
export PATH=$PATH:/usr/local/samba/bin:/usr/local/samba/sbin
source .bashrc 
samba -V
echo '#! /bin/sh
### BEGIN INIT INFO
# Provides:          samba4
# 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/stops the Samba daemon (samba).
# Adapted from the Samba 3 packages.
#
PIDDIR=/usr/local/samba/var/run
SAMBAPID=$PIDDIR/samba.pid
# clear conflicting settings from the environment
unset TMPDIR
# See if the daemon and the config file are there
test -x /usr/local/samba/sbin/samba -a -r /usr/local/samba/etc/smb.conf || exit 0
. /lib/lsb/init-functions
case "$1" in
       start)
               log_daemon_msg "Starting Samba 4 daemon" "samba"
               # Make sure we have our PIDDIR, even if it's on a tmpfs
               install -o root -g root -m 755 -d $PIDDIR
               if ! start-stop-daemon --start --quiet --oknodo --exec /usr/local/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' > /etc/init.d/samba4
chmod a+x /etc/init.d/samba4
update-rc.d samba4 defaults
echo '
search testaus.ebin.local
nameserver 192.168.1.1
' > /etc/resolv.conf
samba-tool domain provision --domain=EBIN --adminpass='Qwerty1' --function-level=2008_R2 --use-xattrs=yes --use-rfc2307 --realm=EBIN.LOCAL
service samba4 restart



Ubuntu serveri

Ubuntu serverillä samba dc ylös lykkiminen on super helppoa. Itse käytin 14.04 LTS

aptitude install acl
aptitude install samba krb5-user smbclient

sitten sambatoolilla domain provision vaan :)

# Global parameters
[global]
       workgroup = TESTI
       realm = testi.local
       netbios name = UBUNTUSRV
       server role = active directory domain controller
       dns forwarder = 8.8.8.8
       allow dns updates = nonsecure and secure
[netlogon]
       path = /var/lib/samba/sysvol/testi.local/scripts
       read only = No
[sysvol]
       path = /var/lib/samba/sysvol
       read only = No


 18  samba-tool domain level raise --domain-level=2008
 19  samba-tool domain level raise --forest-level=2008
[libdefaults]
       default_realm = TESTI.LOCAL
[realms]
       TESTI.LOCAL = {
               kdc = ubuntusrv
               admin_server = ubuntusrv
       }
127.0.0.1       localhost
127.0.1.1       ubuntusrv.testi.local   ubuntusrv
192.168.1.100   ubuntusrv.testi.local   ubuntusrv
Mainos / Advertisement: