Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
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
...
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.