LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-27-2005, 08:08 AM   #1
saustin99
LQ Newbie
 
Registered: May 2005
Posts: 10

Rep: Reputation: 0
Samba Avoid repeating password possible ?


Hi,
On Red Had ES3 have no problem making a samba connection to a W2k
network. Would love it if we could avoid having to enter the password
twice. Once in the command line argument when you include the user id ,
and password and then a SECOND TIME when the network prompts for a
verification of the password. Any ideas around this greatly appreciated
as we need to automate our server startup.

Many thanks, Steve.
 
Old 05-29-2005, 05:22 AM   #2
hob
Senior Member
 
Registered: Mar 2004
Location: Wales, UK
Distribution: Debian, Ubuntu
Posts: 1,075

Rep: Reputation: 45
The simplest option is to put the username and password in a text file and set the permissions on it to ensure that only the account that needs these credentials can read it (check out the "credentials=" option for smbmount and the equivalent -A option for smbclient).

I would suggest that you check your authentication setup though, as IIRC Samba only prompts for the password again like this if it failed to login the first time for some reason.
 
Old 05-31-2005, 09:07 AM   #3
saustin99
LQ Newbie
 
Registered: May 2005
Posts: 10

Original Poster
Rep: Reputation: 0
Samba Avoid repeating password possible

Hi Hob,
Many thanks for your reply. Had tried out that option but to no avail. Have gotten around the issue by using the "mount -t smbfs " method. Works perfectly if logged in to the red hat server as root. Interesting problem still exits that we normally log in to the red hat server as oracle and that gives us "read-only" privileges to the created share.
Have tried giving the oracle user root privileges but am stumped since we do need write capabilities. Steve.
 
Old 05-31-2005, 09:52 AM   #4
hob
Senior Member
 
Registered: Mar 2004
Location: Wales, UK
Distribution: Debian, Ubuntu
Posts: 1,075

Rep: Reputation: 45
You can only execute mount commands with root privileges, although once a share is mounted standard permissions come into play and non-root users can access it as permissions allow. Giving the oracle user root access to perform a mount is obviously not optimal, but giving it write access just means checking the permissions on the local mount point and the remote server.

For less than ideal reasons we use a cron script on a RHEL 3 server to temporarily mount an SMB share, perform some commands and unmount it. The scripts in cron.hourly etc. run with root privileges by default, and we have a credentials file that only root has permissions to read. If this isn't working then I'd suggest looking at the password, and try changing it to remove any reserved characters - reserved characters have to be escaped for non-interactive use (e.g. when used as a command-line argument, or in a credentials file).

Since you want to run the tasks with the local oracle account, you could add "su -" in the cron script to switch from root to the oracle user once the mount is completed:

# ** Naff example of mount and task execution**
# Define user account
user=oracle
# Mount share
mount -t smbfs -o credentials=/home/$user/credentials.txt //server/share /mnt/netdrive/fororacle
# Become user
su - $user
# Do tasks
...
# Revert to root
exit
# End script
umount /mnt/netdrive/fororacle
...

Last edited by hob; 05-31-2005 at 09:58 AM.
 
Old 05-31-2005, 09:57 AM   #5
saustin99
LQ Newbie
 
Registered: May 2005
Posts: 10

Original Poster
Rep: Reputation: 0
Hi again Hob,
My apologies ! Oh the additional space between the comma's in the option area of smbmount did me in.
Took it out and naturally smbmount works as advertised.Clearly your moral support was the inspiration for solving this however.

Cheers, Steve.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
avoid been ask password by ssh with script? Chowroc Programming 6 02-14-2006 05:17 AM
How to avoid the password when a mail sends out fidelis Linux - Security 1 09-13-2004 07:47 AM
Logon samba on other samba password list hernandi Linux - Networking 1 10-14-2003 12:46 PM
Logon samba on other samba password list hernandi Linux - Networking 0 10-14-2003 12:40 PM
Just change Samba password, not Unix password? sorrodos Linux - Networking 1 08-14-2003 07:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:20 AM.

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