Automount passwordless NT Shares as Administrator via /etc/nsmb.conf

I'm creating a bash script to automount remote NT Partitions via samba. I have configured my /etc/nsmb.conf so that the passwords are automatically looked up. A snippet of my /etc/nsmb.conf looks like this:


The command I use in the bash script to mount the Shares is:
mount_smbfs //ADMINISTRATOR@NTSERVER1/Share$ /root/mnt/NTSERVER1

All the above work as a charm when the password for the ADMINISTRATOR at the remote NTSERVER is not null. However, we have a box that has a passwordless Administrator account. We call this Dummy ;) When I try to mount Dummy's Share using the bash script I mentioned earlier, it refuses to mount it unless I press the CR as it prompts for password. I'm mounting the share as normal with:

  mount_smbfs //ADMINISTRATOR@DUMMY/Share$ /root/mnt/Dummy
  Password: [here I press the CR and it mounts it just fine]

I tried adding the following to my /etc/nsmb.conf but with no luck:

As you noticed, I tried to leave the password field blank but the script again prompted me for password.

What I want to do is somehow pass a Newline to the mount_smbfs //ADMINISTRATOR@DUMMY/Share$ /root/mnt/Dummy command in the script so that I don't get prompted for a password or tell nsmb.conf that the password for Administrator@Dummy is blank.

Thx in advance for any help.
Who is Participating?
RomModConnect With a Mentor Commented:
Question closed - 75 points refunded.

Best regards,
Experts Exchange
Community Support Moderator
try this :
is it working?
PhreonxAuthor Commented:
Sorry Funcod but no.
As an alternative, I tried creating an empty file which I call Newline and contains a newline only [I created a file pressed CR and saved it]. Then I appended that file to the mount_smbfs //ADMINISTRATOR@DUMMY/Share$ /root/mnt/Dummy as follows:

mount_smbfs //ADMINISTRATOR@DUMMY/Share$ /root/mnt/Dummy << `cat /folder/subfolder/NEWLINE | head -n1`
but still no good.
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

try alt+0160 or alt+255
its the code for space
if that doesnt work try
PhreonxAuthor Commented:
Still no good. Still asks for password. Apart from trying what you suggested, I also tried ALT+015 in ee, it prompted me to insert ascii code, I entered 013 [CR] but nothing.
u need to use CR+LF (carriage return + line feed)
it should work

PhreonxAuthor Commented:
I tried that but with alt+013 the cursor jumps to a newline and then when I press alt+010, ^@ appears. I run the script but still prompts for password.
PhreonxAuthor Commented:
I know it's very frustruting. A seemingly straightforward procedure taking so long to figure out how to do it. Thx for your time Funcod.
1) it must be done using the number pad
2) your script
-type it using your nt notepad (remember to rename it to the right extension)
-move it to the right folder
-in your script u can try :
 a) alt+010 only
 b) alt+010"+"alt+013
 c) alt+013
you shouldn't get the ^@
it should work unless you havent done the script right
and password=* or password="*" should have worked with nt btw.
good luck
PhreonxAuthor Commented:
I'll try what you recommended when I get home. Im too tired to troubleshoot anything right now. Thx again
PhreonxAuthor Commented:
I spent the entire weekend trying to figure out what's wrong with the nsmb.conf and it doesn't accept blank passwords. Unfortunately, I could not find a solution. So Funcod, if you agree I would like to close this question, setup a bloody password at the Dummy box and get this thing over with because I can't spent much more time on this matter.
PhreonxAuthor Commented:
Thx for all your help. Closing now
it does not run nsmb.conf for password for obvious reasons. password is read from ~/.nsmbrc if ever.
PhreonxAuthor Commented:
Thanks for the tip gheist but as I mentioned at an earlier post, I've already setup a password for Dummy because at that time, I could not afford to look for an answer to my problem any more. I really appreciate you answering and I will try to implement your solution if a similar situation arises.
I did not pretend to offer solution. Just noticed smth forgotten...
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.