Jan 12 2011

Store Windows Credentials for Auto Login

Published by at 12:06 am under Windows

Windows prompts for a login and password when the current logged in user wants to access a share on a domain or workgroup that does not match the one you’ve logged in. It is possible to store identification information or “credentials” so you’re not prompted for the login and password every time you access the Windows share.
 

From the Command Line

 
Server_address can be replaced with the host name or IP address.

C:\>net use * \\Server_address\My_Share /savecred
The password or user name is invalid for \\Server_address\My_Share.

Enter the user name for 'Server_address': MyDomain\Administrator
Enter the password for Server_address:
Drive Z: is now connected to \\Server_address\My_Share.

The command completed successfully.

 
All shares on the remote machine are now reachable, if the saved username is authorized to.

C:\>DIR \\Server_address\My_Other_Share
 Volume in drive \\Server_address\My_Other_Share is System
 Volume Serial Number is 7CBD-E099

 Directory of \\Server_address\My_Other_Share

03/08/2009  11:11              .
03/08/2009  11:11              ..
               0 File(s)                0 bytes
               3 Dir(s) 28 764 954 624 bytes free

 
A volume Z: is automatically created but can be removed safely.
 

Storing Credentials in the Control Panel

 
Storing credentials is also possible through the control panel in some Windows but all:
Control Panel -> Stored User Names and Passwords on Windows Server
or
Control Panel -> User Accounts -> Advanced -> Manage on Windows XP
 

From a Unix/Linux station

mount -t cifs //Server_address/Share /mount_point -o cred=credential.txt


The credential.txt file contains the shared folder authentication details:

username=my_username
password=my_password

 
Access should be granted to the owner exclusively since values are stored in a clear text file. Set file permissions to 700.


No responses yet

Comments RSS

Leave a Reply