sudo su
after that, you will work as root. sudo nano /etc/network/interfaces
iface eth0 inet dhcplet's change the settings to use a static ip-address.
auto loAfter changing the network settings, you must restart the network service.
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.10.1
netmask 255.255.255.0
gateway 192.168.10.10
dns-nameservers 192.168.10.10
dns-search domain.local domain
/etc/init.d/networking restart
apt-get install ssh
apt-get update && apt-get upgrade
apt-get install ntp
apt-get install git checkinstall build-essential libacl1-dev libattr1-dev libblkid-dev libgnutls-dev libreadline-dev python-dev python-dnspython gdb pkg-config libpopt-dev libldap2-dev dnsutils libbsd-dev attr docbook-xsl libcups2-dev acl
nano /etc/fstab
Should get a string, something like this:/ dev / mapper / dc1 - vg-root / ext4 user_xattr, acl, barrier = 1, errors = remount-ro 0 1after which you need to restart the computer
reboot
Do not forget about root rights sudo su
cd /usr/src git clone -b v4-1-stable git://git.samba.org/samba.git samba-v4-1-stable
cd samba-v4-1-stable && ./configure --enable-debug && make && checkinstall
The --enable-debug parameter is required to display more detailed information in Samba logs. nano /etc/sudoers
it should make something like this:Defaults secure_path = "/ usr / local / sbin: / usr / local / bin: / usr / sbin: / usr / bin: / sbin: / bin : / usr / local / samba / sbin: / usr / local / samba / bin "
nano /etc/environment
it should make something like this:PATH = "/ usr / local / sbin: / usr / local / bin: / usr / sbin: / usr / bin: / sbin: / bin: / usr / games : / usr / local / samba / sbin: / usr / local / samba / bin "
reboot
service bind9 stop && update-rc.d bind9 disable
samba-tool domain provision
ERROR (ldb): uncaught exception - 0000052D: Constraint violation - check_password_restrictions: the password is too short. It should be equal or longer than 7 characters!then before re-performing the initial configuration, you must delete the contents of the / usr / local / samba / private / and / usr / local / samba / etc / directories
samba-tool domain passwordsettings set --min-pwd-length=6 --complexity=off --max-pwd-age=0 --min-pwd-age=0
this command disables the complexity requirement, disables password expiration, sets a minimum password length of 6 characters nano /usr/local/samba/etc/smb.conf
allow dns updates = nonsecure and secureThis will allow you to dynamically update the DNS records on the server when the workstation (under windows control) enters the domain and disable printing support, which constantly generates errors in the log.
printing = bsd
printcap name = / dev / null
echo "nameserver 127.0.0.1" >> /etc/resolvconf/resolv.conf.d/head
and restart the resolvconf service service resolvconf restart
apt-get install krb5-user
and configure it on AD using the file created at the stage of the samba-tool domain provision mv /etc/krb5.conf /etc/krb5.conf.old cp /usr/local/samba/private/krb5.conf /etc/krb5.conf
nano /etc/init.d/samba4
#! /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=/var/run/samba 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/samba4 {start|stop|restart|force-reload}" exit 1 ;; esac exit 0
chmod 755 /etc/init.d/samba4
update-rc.d samba4 defaults
reboot
ps aux | grep samba
root 865 0.3 3.0 95408 31748? Ss 18:59 0:00 / usr / local / samba / sbin / samba -D
nslookup dc1
Server: 127.0.0.1
Address: 127.0.0.1 # 53
Name: dc1.domain.local
Address: 192.168.10.1
smbclient -L localhost -U%
Domain = [DOMAIN] OS = [Unix] Server = [Samba 4.1.6]
Sharename Type Comment
- - - netlogon Disk
sysvol disk
IPC $ IPC IPC Service (Samba 4.1.6)
Domain = [DOMAIN] OS = [Unix] Server = [Samba 4.1.6]
Server Comment
- - Workgroup Master
- -------
kinit administrator
Warning: Your password will expire in 41 days on Wed Apr 23 18:49:14 2014
klist
Valid starting Expires Service principal
03/12/2014 19:17 03/13/2014 05:17 krbtgt/DOMAIN.LOCAL@DOMAIN.LOCAL
smbclient //localhost/netlogon -UAdministrator -c 'ls'
Domain = [DOMAIN] OS = [Unix] Server = [Samba 4.1.6]
. D 0 Wed Mar 12 18:46:48 2014
... D 0 Wed Mar 12 18:49:15 2014
Source: https://habr.com/ru/post/215573/
All Articles