Linux SAMBA question

Moonark

Senior member
Oct 9, 1999
387
0
0
Is there a way to mount windows shares in Linux using a domain username and password? I know you can do it by using a passowrd on a machine such as smbmount //mycomputer/share /home/Moonark/myshare -o username=Moonark that is how I would connect to my local machine. Can it be done if my machine is on a domain, and use the domain username and password instead of one on the local machine? There has got to be a way because I hear about people using it in businesses but I have no idea how to set it up.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Just use the username domain\\username (2 backslashes because it's a special character and you have to espcape it with another backslash)
 

Moonark

Senior member
Oct 9, 1999
387
0
0
Ok, my next question is, is there a way to have a sort of login script run when a user logs in so that these shares will connect automatically?
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
You could script it a few ways, but the problem is the password, there's no way to get it automatically so you'd need a program to prompt the user for it.
 

manly

Lifer
Jan 25, 2000
13,288
4,063
136
I don't know how secure it would be, but (at least for server authentication) you can append the password to the username, delimited by %. Quick example with smbmount:

# smbmount //server/share /mnt/share -o username=username%password,workgroup=WORKGROUP

I assume you can stick the appropriate options into fstab, and it would be automatically mounted upon boot. However, I'm not sure if that's a secure solution.
 

Moonark

Senior member
Oct 9, 1999
387
0
0
I could write a little GUI to handle the password entries, but is there a way to automatically grab the username? In WIN2K I can use %username% to get the name, is there a way to do that in linux? Once I get that I can have a box pop up with a password field.