Actually the documentation on smbnetfs states that it reads ${HOME}/.smb for the user who issued the mount command and since vmassuchetto making mount through fstab, that user will be root.
There is however a solution:
In /root/.smb/smbnetfs.conf
is a string:
#read auth data from ~/.smb/smbnetfs.auth
include "smbnetfs.auth"
If memory serves me well, by default this should be commented out.
If path to smbnetfs.auth
isn't provided, as is in above example, smbnet fs will look for it in ~/.smb/
.
So you can place smbnetfs.auth
anywhere on file system and with any permissions to provide the user the way to edit it.
I'd suggest vmassuchetto to uncomment this and create a file /root/.smb/smbnetfs.auth
with flowing content:
auth USER_NAME "USER_PASSWORD"
auth WORKGROUP USER_NAME "USER_PASSWORD"
auth COMPUTER_NAME USER_NAME "USER_PASSWORD"
auth COMPUTER_NAME/SHARE_NAME USER_NAME "USER_PASSWORD"
First line will instruct smbnetfs how to handle all not specifically mentioned computers.
Second line will instruct smbnetfs how to handle all computers from workgroup and/or domain with that name.
Third line will provide credentials for specific computer and forth is for a share on a specific computer.
All strings should start with word auth
for credentials or with #
for comments.
All parameters can be encased in "
to shield special symbols, same way as "USER_PASSWORD"
in example above.
Parameter USER_NAME
can be specified with leading domain name or workgroup: DOMAIN_OR_WORKGROUP/USER_NAME
And as last resort you can always use this command:
cd /media/network/DOMAIN_OR_WORKGROUP:USER_NAME:USER_PASSWORD@COMPUTER_NAME