-   Linux - Software (
-   -   A bash script that hits "ENTER"? (

okos 08-05-2009 12:04 AM

A bash script that hits "ENTER"?
smbclient -L <ip address> prompts for a password or you can just hit "ENTER" to list the available shared files and printers.

I am writing a script to do it automatically. However, when I execute the script I am still prompted for a password. How can I get the script to automatically hit "ENTER".


Is it possible to have smbclient access a credentials file for user name and password?

chrism01 08-05-2009 12:10 AM

Sounds like you want the -N option

okos 08-05-2009 10:45 PM

Yea! That did it.

smbclient -L <ip address> -N

This was what I was looking for. I think it is a better option to use the smb username and password in a credential file with 400 permission.

smbclient -L <ip address> -A /path/to/credential/file
You will then need to create a credential file:

username = <value>
password = <value>
domain  = <value>

All times are GMT -5. The time now is 07:30 PM.