LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   A bash script that hits "ENTER"? (https://www.linuxquestions.org/questions/linux-software-2/a-bash-script-that-hits-enter-745187/)

okos 08-05-2009 12:04 AM

A bash script that hits "ENTER"?
 
Hi,
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".

OR

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 http://us1.samba.org/samba/docs/man/...bclient.1.html

okos 08-05-2009 10:45 PM

Yea! That did it.
Quote:

smbclient -L <ip address> -N
Thanks

edit
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.
Code:

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

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



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