From: Mikael Petterson on
Hi,

I am trying to access a windows share:

smbclient //Esekina008//Netwise_Dev//_ProductDevelopment//Products//clearcase//tools//jalopy//1.9//convention
-U eraonel



I am using the correct password
Password:
session setup failed: NT_STATUS_LOGON_FAILURE

Any ideas what I am doing wrong?

cheers,

//mikael
--
Mikael Petterson
Software Designer


Ericsson AB, Stockholm, Sweden
Visiting address: Isafjordsgatan 15, Kista
Phone: +46 70 2673044
E-mail: mikael.petterson(a)ericsson.com

From: Dances With Crows on
Mikael Petterson staggered into the Black Sun and said:
> smbclient //Esekina008//Netwise_Dev//_ProductDevelopment [snip]
> -U eraonel
> session setup failed: NT_STATUS_LOGON_FAILURE
> Any ideas what I am doing wrong?

Forgetting the "-W domain_or_workgroup" parameter? A lot of people seem
to forget that. The Samba suite should default to using the workgroup
specced in /etc/samba/smb.conf , but you may not have that set up
properly. Also, you're using //s in places where /s are more
appropriate. //BORG/SHARE , not //BORG//SHARE . Also also, I believe
you have to mount share names, not subdirectories of shares. "mount -t
smbfs //borg/share /mnt/borg -o lfs,username=user,workgroup=domain", not
//borg/share/path/to/somewhere . And most of the time, unless you have
special needs, using mount.smbfs (or mount.cifs) is much more flexible
than using smbclient.

--
207. The following are not legal weapons in a duel: Steamrollers,
Nerve Gas, Land Mines, Midgets.
My blog and resume: http://crow202.dyndns.org:8080/wordpress/
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
From: Dan Espen on
Mikael Petterson <mikael.petterson(a)ericsson.com> writes:

> Hi,
>
> I am trying to access a windows share:
>
> smbclient //Esekina008//Netwise_Dev//_ProductDevelopment//Products
> //clearcase//tools//jalopy//1.9//convention
^^^^^^^^^

That's not a Clearcase VOB is it?
From: Balwinder S Dheeman on
On 04/24/2008 08:04 PM, Mikael Petterson wrote:
> I am trying to access a windows share:
>
> smbclient //Esekina008//Netwise_Dev//_ProductDevelopment//Products//clearcase//tools//jalopy//1.9//convention
> -U eraonel
>
> I am using the correct password
> Password:
> session setup failed: NT_STATUS_LOGON_FAILURE
>
> Any ideas what I am doing wrong?

I use autofs and an autofs/shell script do automate the mount/umount
operations for samba/windows shares:

-------- 8< --------
#!/bin/sh

# $Local: localtools/etc/auto.smb,v 1.8 2008-04-25 02:14:32 bsd Exp $

# Look at what an lmhost is sharing to determine what we can mount. This is
# very simple, but it appears to work surprisingly well; lmhost is LAN
MANAGER,
# Samba and, or any Windows host and the lmgroup is WORKGROUP :)

# Parse lmhost and, or lmgroup from parameter $1
lmhost="${1%%@*}"
lmgroup="${1##*@}"

# FIXME: Override a bug/feature in autofs; it's working only for me, but is
# genric enough to be usable by one of some other $HOME too.
[ -z "$HOME" ] || HOME="/home/bsd"

# Try finding our default workgroup, if none specified
if [ -z "$lmgroup}" ]; then
if [ -r /etc/samba/smb.conf ]; then
lmgroup="`awk '/[[:space:]]*workgroup[[:space:]]*=/ {print $3}'
/etc/samba/smb.conf`"
fi
[ -z "$lmgroup}" ] || lmgroup="UNIVERSE"
fi

# Get username from $HOME/.sambarc
user=`awk -F= '/username/ {print $2}' $HOME/.sambarc`

# Add/edit other applicable smbfs/mount options here.
# Note: "nonstrict" is now set by default, remove it if you don't want it.
opts="-fstype=smbfs,credentials=$HOME/.sambarc,uid=$user,gid=$user,file_mode=0664,dir_mode=0775,nonstrict"

# List samba/windows/lan-manager shares available on target lmhost and,
or lmgroup.
LISTMOUNTS="/usr/bin/smbclient -A $HOME/.sambarc -gNL $lmhost -W$lmgroup"

$LISTMOUNTS 2>/dev/null | LC_ALL=C sort -k1 | \
awk -v lmhost="$lmhost" -v opts="$opts" -F'|' -- '
BEGIN { ORS=""; first=1 }
/Disk/ { if (first) { print opts; first=0 }; sub(/ /, "\\ ", $2); print
" \\\n\t /" $2, "://" lmhost "/" $2 }
END { if (!first) print "\n"; else exit 1 }
' | grep -v '\$'
-------- 8< --------

the $HOME/.sambarc (chmod 600) should read:
-------- 8< --------
username=you
password=yourpasswd
-------- 8< --------

and my /etc/auto.master is:
-------- 8< --------
#
# $Id: auto.master,v 1.4 2005/01/04 14:36:54 raven Exp $
#
# Sample auto.master file
# This is an automounter map and it has the following format
# key [ -mount-options-separated-by-comma ] location
# For details of the format look at autofs(5).

/net /etc/auto.net --timeout=20
/smb /etc/auto.smb --timeout=20
-------- 8< --------

You might want to customize all these a bit and restart/reload
/etc/init.d/autofs, then try:

cd /smb
cd winhostname(a)WORKGROUP

Hope that helps,
Cheers,
--
Dr Balwinder S "bsd" Dheeman Registered Linux User: #229709
Anu'z Linux(a)HOME (Unix Shoppe) Machines: #168573, 170593, 259192
Chandigarh, UT, 160062, India Gentoo, Fedora, Debian/FreeBSD/XP
Home: http://cto.homelinux.net/~bsd/ Visit: http://counter.li.org/