Smbclient asking for password
37,665
It should be possible to do it.
From man smbclient
:
-U|--user=username[%password]
Sets the SMB username or username and password.
If %password is not specified, the user will be prompted.
So you could use something like :
/usr/bin/smbclient \\\\server78\\publicfolder -U=user%password
Related videos on Youtube
Comments
-
fightstarr20 over 1 year
I am connecting to a samba share using the following command..
/usr/bin/smbclient \\\\server78\\publicfolder
It asks me for my linux account password before it will connect.
This isn't a problem if I am running it manually but how can I use this within a bash script without it asking me for the password?
-
fightstarr20 almost 8 yearsBut surely this is for setting the username and password for the samba share?
-
magor almost 8 yearsit is for providing the user and password for the samba share in order to access it
-
fightstarr20 almost 8 yearsThat is not what the original question asks, it asks for the current linux user account password, not the samba share password
-
roaima almost 8 years@fightstarr20 the username and password specified by the
-U
flag is the username and password required to access the share. Whether those credentials are Samba specific or your usual Linux credentials depends how the share has been defined on the server. If this is insufficient you'll need to update your question to include the [global] and [share]-specific sections of yoursmb.conf