Samba Q?

Gordon Messmer yinyang at eburg.com
Wed Oct 24 20:23:19 UTC 2007


Gene Heskett wrote:
> 
> How about in a custom /etc/init.d/asmb file, so I can do a 'service asmb 
> lappyup' and the lappy, if present on the network, will be mounted as a cifs 
> share on /mnt/lappy?  If its defined as 
> user=somebody,passwd=somebodies-long-password in the mount.cifs command in 
> that script, its said to be too long, and it is nearly 20 characters long.  
> However, if I cat the line from the file, copy & paste it but without the 
> passwd portion and exec it, it then asks me for it, and its fine with that 
> long a passwd from the interactive shell.  Why can't I put it in the script?

It appears to be an arbitrary limitation in mount.cifs.  It looks to me 
like it'll take a password of up to 64 characters if it's specified in 
the credentials file, or if you specify "-o user%password", or if you 
specify '--password' or '-p' with a password as command line arguments, 
or if it's in the PASSWD environment variable.  You are only limited to 
17 characters if you use the '-o user=name,passwd=pass' construct.  It's 
probably a mistake left over from the first version of that program, 
which was super ugly.

Since Linux doesn't protect command line arguments or environment 
variables from other users, I recommend using the credentials file.  It 
should be owned by root, and mode 0400.  Even if you're on a single user 
system now, this is a good habit to develop.




More information about the fedora-list mailing list