# smbclient windows share

## LostGen

I emerged samba and dont want to setup a samba server, I just want to use the client functions so that I can connect to some of my file servers. I am correct in thinking I dont need the samba server running to be able to use the smbclient?

So lets say I have a file server that is a member of a windows 2003 domain with a share called \\windows2003\myshare$  and the security on that share is allow anyone who is a domain user. I also have an account on the domain called myuser@mydomain.com with a password of mypass123.

So from the shell I type: 

gentoo~ smbclient //windows2003/myshare$ -U myuser@mydomain.com

password: mypass123

session setup failed: NT_STATUS_LOGON_FAILURE

Any ideas on what I am screwing up here? If I do a smbtree I can see the domain and all the computers... if that helps..

Thanks

Chris

----------

## d4rkwingduck

cant help u with the smbclient but what if u mount the share locally ?

----------

## LostGen

Sorry for the dumb response but how do I mount the share locally?

----------

## LostGen

Ok when I try to run the following:

mount -t smbfs -o username=myuser,password=mypass //windows2003/mysharel /mnt/myshare

This gave me the following error.

22570: session setup failed: ERRDOS - ERRnoaccess (Access denied.)

SMB connection failed

Alas I am having little luck with this.

LG

----------

## d4rkwingduck

create some folder on your drive or use an existing one say that folder is /mnt/smb

then

```

mount -t smbfs //windows2003/myshare$ /mnt/smb

```

when u get the prompt for the password type that in, and then u ccan access the remote files in /mnt/smb  :Wink: 

----------

## LostGen

 *kel wrote:*   

> create some folder on your drive or use an existing one say that folder is /mnt/smb
> 
> then
> 
> ```
> ...

 

When I tried this out I still get this error.

22570: session setup failed: ERRDOS - ERRnoaccess (Access denied.)

SMB connection failed 

LG

----------

## nE0

 *LostGen wrote:*   

> I emerged samba and dont want to setup a samba server, I just want to use the client functions so that I can connect to some of my file servers. I am correct in thinking I dont need the samba server running to be able to use the smbclient?
> 
> So lets say I have a file server that is a member of a windows 2003 domain with a share called \\windows2003\myshare$  and the security on that share is allow anyone who is a domain user. I also have an account on the domain called myuser@mydomain.com with a password of mypass123.
> 
> So from the shell I type: 
> ...

 

Have you tried that without @mydomain.com

----------

## LostGen

 *Quote:*   

> Have you tried that without @mydomain.com

 

When I remove the @domain.com I get the following:

session setup failed: NT_STATUS_LOGON_FAILURE

----------

## plut0

You're close...the username syntax is wrong however.  It should be $domain+$username.  If $domain=example and $username=test it would be:

```
smbclient //windows2003/myshare$ -U example+test

or

smbmount //windows2003/myshare$ /mnt/tmp -o username=example+test
```

----------

## nly00471

 *Quote:*   

> smbmount //windows2003/myshare$ /mnt/tmp -o username=example+test

 

this syntax worked for me, but how can I make it automount while booting including username and password so that I can access it directly after booting

----------

## plut0

Add this to your /etc/fstab:

```
//windows2003/myshare$ /mnt/tmp smbfs credentials=/root/credentials.conf,rw,lfs 0 0
```

And create this file /root/credentials.conf:

```
username = DOMAIN\username

password = secret
```

This will keep the login credentials out of a world read file so no one will steal your password.

----------

## d4rkwingduck

 *Quote:*   

> 
> 
> This will keep the login credentials out of a world read file so no one will steal your password.

 

just being an arse here .. but what if they use a live cd, mount the partition, read the file and out comes the password [/quote]  :Twisted Evil: 

----------

