LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-06-2006, 10:26 AM   #1
watchingant
LQ Newbie
 
Registered: Apr 2006
Posts: 2

Rep: Reputation: 0
Configuring script to automate SMB connections


I am trying to create a script that will allow my servers to automatically connect to a Windows 2000 server. This is what I am trying to use for the script:

mount -t smbfs //servername/share /mnt/mntpoint -o username=username,workgroup=domain,password=password

or

mount -t smbfs //servername/share /mnt/mntpoint -o username="domain\username",password=password

When i run either of these I get an smb error, "Access denied, SMB connection failed". When I take out the password and run it, I get prompted for the password and then am able to connect. Can someone tell me what I am doing wrong
 
Old 07-06-2006, 10:52 AM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Try this

Code:
mount -t smbfs //servername/share /mnt/mntpoint -o credentials=/a/file/with/login/parameters
/a/file/with/login/parameters must contain

username=whoYouAre
password=yourPassword

and should not be world readable, for obvious reasons. You can put this into /etc/fstab so your shares are mounted at boot time without user intervention.

--- rod.
 
Old 07-06-2006, 01:56 PM   #3
watchingant
LQ Newbie
 
Registered: Apr 2006
Posts: 2

Original Poster
Rep: Reputation: 0
created fix

I added the previous text I was using to the /etc/fstab file and it worked just fine.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Automate SSH Script Gentoo20 Linux - General 11 03-22-2006 06:21 PM
how to automate telnet login, script or something kiwibird Linux - Networking 2 11-09-2005 02:02 PM
automate script w/ cron viniosity Linux - Newbie 5 02-02-2005 03:13 PM
Creating Secure SMB Connections scottpioso Linux - Networking 17 12-03-2003 08:07 AM
Script that would automate adding users zyft02 Linux - Newbie 4 02-25-2002 11:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration