Posts Tagged ‘samba’

winexe to interact from linux to windows hosts

Thursday, November 24th, 2011

With pstools You can run any command from your Windows PC to any other one. A valid command line alternative to pstools for the linux operating system is winexe.

To install winexe un a natty-ubuntu host (maybe it will work on a quite new debian too), You can add theese twho lines to your sources.list file:

deb http://ppa.launchpad.net/jdthood/winexe/ubuntu natty main

deb-src http://ppa.launchpad.net/jdthood/winexe/ubuntu natty main

then

apt-get update && apt-get install winexe

Once installed winexe, you can do useful things like

winexe //myserver1 –user “DOMAIN\\user” “tasklist /FI \”CPUTIME gt 00:00:10\””

or simply

winexe //myserver2 –user “Administrator” cmd

and many others! 🙂

How to mount a windows share under AIX

Thursday, September 8th, 2011

To mount a windows share from an AIX server it’s needed the CIFS support to be installed.

If Your server /sbin/helpers directory contains a file called mount_cifs no problem

ls -l /sbin/helpers
total 488
-r-xr-xr-x    1 root     system        33198 Jul 13 2010  aufsmnthelp
drwxrwxr-x    2 root     system         4096 Apr 15 2010  jfs2
-r-xr-xr-x    1 root     system        23224 Jul 13 2010  mount_cifs
-r-xr-xr-x    1 root     system        35638 Jul 13 2010  nfsmnthelp
-r-xr-xr-x    1 bin      bin            6268 Dec 18 2009  udfmnthelp
-r-xr-xr-x    1 bin      bin          138292 Dec 18 2009  v3fshelper

Otherwise You need to install it.

Then You can try to mount the Windows share using the mount command, specifying the cifs filesystem, the node name/IP, username, password and so on…

mount -v cifs -n node/username/passw [-o options] /winshare /directory

e.g.

mount -v cifs -n 192.168.1.28/george/HareKrishna \
-o wrkgrp=BEATLES,fmode=755 \
IndiaPics /opt/holidays/meditation/india1967

How to make a Debian Lenny Box leave a M$ Active Directory Domain

Thursday, July 9th, 2009

In order to remove a linux box from an Active Directory domain, just do a

# net ads leave  -U adminaccount -W DOMAIN

Joining a Debian Lenny Box to a M$ Active Directory Domain

Thursday, May 7th, 2009

Install the software You need:

# apt-get install samba-common heimdal-clients winbind ntpdate ntp samba

set the right timezone and the righ system time

# /etc/init.d/ntp stop
# dpkg-reconfigure tzdata
# ntpdate your.domain.controller

then insert Your domain controller into the time servers list:

# vi /etc/ntp.conf

add in the right place the line

# You do need to talk to an NTP server or two (or three).
#server ntp.your-provider.example
server your.domain.controller
# /etc/init.d/ntp start

Edit Your file /etc/krb5.conf

# cat /etc/krb5.conf
[libdefaults]
default_realm = DOMAIN.NAME
clockskew = 300
[realms]
DOMAIN.NAME = {
kdc = your.domain.controller IP Address
admin_server = your.domain.controller IP Address
}

Edit Your file /etc/samba/smb.conf

# cat /etc/samba/smb.conf
[global]
realm = DOMAIN.NAME
workgroup = domain
security = ADS
idmap uid = 10000-20000
idmap gid = 10000-20000
template shell = /bin/bash
template homedir = /home/%D/%U
winbind use default domain = yes

[homes]
valid users = %U

check your modification with

# testparm

and then

# mkdir /home/DOMAIN

Then edit the /etc/nsswitch.conf file:

passwd:        files winbind
group:          files winbind
#passwd:         compat
#group:          compat

Now issue the command:

# net ads join -U DomainAdminUsername -W DOMAIN.NAME

Ignoring the error notice saying something like “Unable to perform DNS Update”.

Then restart some services:

# /etc/init.d/samba restart
# /etc/init.d/winbind restart

And verify You have joined the Domain, e.g. asking for some data to be displayed:

# wbinfo -u |xargs getent passwd

… and remember to modify theese files

# cat /etc/pam.d/common-account:
account    sufficient    pam_winbind.so
account    required    pam_unix.so

# cat /etc/pam.d/common-auth:
auth    sufficient    pam_winbind.so
auth    required    pam_unix.so use_first_pass

# cat /etc/pam.d/common-session:
session    required    pam_mkhomedir.so skel=/etc/skel/ umask=0022
session    sufficient    pam_winbind.so
session required    pam_unix.so