Sie sind auf Seite 1von 3

EXER 2

SAMBA UBUNTU Server instructions


1.) Make Network Adapter 1 to Bridge Adapter or VirtualHosts* depending on
requirement
Then Make Network Adapter 2 to NAT for internet connection
---2.) edit using vi /etc/network/interfaces and add eth1. Just copy how it's done
in eth0 then reboot
3.) Enter sudo sh (sudo mode)
4.) do >> apt-get update
5.) do >> apt-get install samba -> check ls -l /etc/samba if smb.conf exists. If
file size 0 reinstall**
6.) do >> apt install samba libpam-winbind
6.5) change network adapter to bridge adapter
6.6.) reboot
7.) backup smb.conf just in case something happens by doing >> cp
/etc/samba/smb.conf /etc/samba/smb.conf.backup
8.) edit smb.conf by >> vi /etc/samba/smb.conf
FOR VI editor note:
press i to enter type mode.
press esc to exit type mode.
type :wq to exit and save changes of vi editor
type :q to exit without saving changes of vi editor
if :q doesn't work. Try >> :q!
9.) Under [global] type the following:
workgroup = (YOURDOMAINNAME)
domain logons = yes
security = user
wins support = yes
lanman auth = yes
ntlm auth = yes
name resolve order = bcast host lmhosts wins
domain master = yes
local master = yes
preferred master = yes
os level = 64
10.) Under Authentication > server role change the setting to:
server role = classic primary domain controller
11.) Uncomment SECOND logon path under Domains:
logonpath = \\%N\%U\profile
and uncomment:
logon drive,
logon home,
logon script
add machine script
12.) Under Share Definitions, uncomment [homes] and any semicolon under it.
Make sure you have these settings underneath [homes]. Type in the additional ones
as well:
[homes]
comment = Home Directories
browseable = no
read only = no
writable = yes
13.)Uncomment [netlogon] as well and anything under it. Make sure path is
path = /srv/samba/netlogon
14.)Uncomment [profiles] too and anything underneath it.

16.) Save the configuration


17.) Then issue these commands:
mkdir -p /srv/samba/netlogon
chmod 755 /srv/samba/netlogon
touch /srv/samba/netlogon/logon.cmd
chmod 755 /srv/samba/netlogon/logon.cmd

addgroup machines
addgroup smbadmin
net groupmap add ntgroup="Domain Admins" unixgroup=smbadmin rid=512 type=d
net groupmap add ntgroup="Domain Users" unixgroup=users rid=513 type=d
net groupmap add ntgroup="Domain Guests" unixgroup=nogroup rid=514 type=d

18.) restart samba by:


restart smbd
restart nmbd

19.) smbpasswd -a root and input a decent password OR

OPTIONAL create a new user with admin rights:


adduser admin --ingroup smbadmin --shell /bin/false --gecos ''
smbpasswd -a admin
net -U admin rpc rights grant "Domain Admins" \
SeMachineAccountPrivilege SePrintOperatorPrivilege \
SeAddUsersPrivilege SeDiskOperatorPrivilege \
SeRemoteShutdownPrivilege SeTakeOwnershipPrivilege \
SeRestorePrivilege
NOTE: when asked for password after thing this^ command, use the password for
smbdpasswd previously

And done!

To add a regular user do:


adduser --shell /bin/false --gecos '' (newusername)
smbpasswd -a (newusername)

*to make virtual box hosts-only adapter


Go to File>Host Network Manager
There usually is a default host-only adapter
if not create a new one and enable DHCP(this is just in case for the server)

** to reinstall samba:
1.) enter sudo mode: sudo sh
2.) apt-get remove samba --purge
3.) apt-get autoremove
4.) rm -R /etc/samba
5.) apt-get purge samba-common

Windows OS instructions
1.) Adjust appropriate network adapter in VirtualBox
2.) If network is public and cannot be adjusted - adjust the proper ip address,
subnet mask and default gateway along with the DNS IP address of the server
ip address should be the ip address seen on cmd ipconfig command (ONLY FOR VIRTUAL
HOST-ONLY ADAPTER)
subnet mask must be the same as the server
default gateway must be the one provided in the adapter
3.) go to REGEDIT to edit registry, then go to
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanWorkstation\Parameters
EnableSecuritySignature=0
Use DWORD to create these:
DomainCompatibilityMode=1
DNSNameResolutionRequired=0
5.) If Win7 was Cloned, change Computer name to something else first
6.) Reboot
4.) IMPORTANT TURN OFF>>WORK NETWORK FIREWALL (Normally for Virtual Host-Only
Adapter. But if Bridge Adapter doesn't work, do this)
7.) Ensure that both server and client can ping each other. To check if client
actually receives a ping, you must open the connection(LAN connection)
in Network and Sharing Center then ping from server. You can see from the
Activity graphic representation that it's receiving packets
8.) Then go to my computer, right click>properties, then under computer name,
domain, and workgroup settings
click Change Settings
Go to Change
9.) Under Member Of and the Domain field, type the Domain name that was setup on
SAMBA
10.) A login form should popup then input either root or admin, whichever was set
earlier for smbpasswd with admin rights

***if "remote connection forcibly closed" appears if using Virtual Hosts adapter:
1.) check host cmd and do ipconfig /all.
2.) check if Virtual Box Host-Only adapter has no gateway.
3.) If it has no gateway, set default gateway through cmd w/ admin rights to:
0.0.0.0
netsh interface ip set address "(connection name)" static (ip address)
(subnet mask) (default gateway)
4.) then reinstall ubuntu server

----------
userlist for my laptop samba profiles
root
nuser

for v3 Windowsname

the rest of the servers are then just increment.

test new ubuntu server

note to self: reformat ubuntu server in school

Das könnte Ihnen auch gefallen