Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a list of IP's for computers in my LAN, I don't want to enter password for computers that require password, So I would like to skip such PC's.

gvfs-mount smb://servername

I'm using the above command for mounting, So how to skip PC's that require password from trying to mount..

I had a script which consists of a list like gvfs-mount smb://servername1, gvfs-mount smb://servername2, gvfs-mount smb://servername3 ... and when I run the script I would like to skip PC's with password

share|improve this question
    
Please clarify. What/where are you mounting from? Are you doing this in a script? Manually? Reading the IPs from a list? Please tell us some more information. For example, do you already know which IPs need a password or do you need to find that out? –  terdon Mar 18 at 18:19
    
yes, I had a script which consists of a list like gvfs-mount smb://servername1, gvfs-mount smb://servername2, gvfs-mount smb://servername3 ... –  gowtham nanda Mar 18 at 18:22
    
Please edit your question to add more information, it is hard to read and easy to miss in the comments. So, please include a minimal example of your script and explain if you already know which servers require passwords. If not, why not just try mounting them all, write down the ones that ask for passwords and remove them from your script? –  terdon Mar 18 at 18:26
add comment

1 Answer 1

Remove the hosts that require a password, from your script. If you're going to skip them anyway, then there's no need to have them there.

Alternatively, save the passwords permanently in your keyring, when the dialog pops up to ask for the passwords, and you won't be asked in the future, unless the password is changed on the server, when you run the script while logged in. Or you can encode the passwords in the URLs you're passing to gvfs-mount inside the script, but that is not as secure.

share|improve this answer
    
What if there are 200 PC's, In such case I may not be able to do manually, So I need an alternative solution. –  gowtham nanda Mar 18 at 18:40
    
Then you have to do it manually. There is no way to automate it with gvfs-mount. –  dobey Mar 18 at 18:42
    
So is there anyway to distinguish PC's protected with password and PC's with no password –  gowtham nanda Mar 18 at 18:45
    
Sure. Write your own version of gvfs-mount to do what you want. –  dobey Mar 18 at 19:11
    
Great idea ! thanks –  gowtham nanda Mar 18 at 20:23
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.