Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've created a script to mount the windows server network shares, but it keeps me asking for the network password. I've already tried setting the PASSWD env var and setting the password in the command.

Here's what I have:

sudo mount.cifs //IP/Utils /media/Data/Utils -o username=sergio, password=MyPassword..., uid=sergio, file_mod=0755, dir_mode=0755, gid=sergio, workgroup=myworkgroup

I tried also with sec=ntlm (looked at another question, don't remember where) but no avail.

Why it keeps me asking the password?

share|improve this question
up vote 2 down vote accepted

From mount.cifs manpage:

Options to mount.cifs are specified as a comma-separated list of key=value pairs.

So there should be no space between the options, only commas:

sudo mount.cifs //IP/Utils /media/Data/Utils -o username=sergio,password=MyPassword...,uid=sergio,file_mode=0755,dir_mode=0755,gid=sergio,workgroup=myworkgroup
share|improve this answer
Sorry for the late reply, AskUbuntu didn't notified me [?]. I already tried that, it show's me mount error(22): Invalid argument – Sérgio Michels Oct 1 '13 at 10:58
Ok, trimming white spaces and changing file_mod to file_mode do the trick. Thanks! – Sérgio Michels Oct 1 '13 at 11:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.