Problem using pstools for the first time: /accepteula

I’ve found that executing pstools directly from the console, without gui (in my case, using winexe ), it got stuck, sort of hung. Trying to connect via remote desktop to the server, and executing then by hand, it shows a window with an EULA, waiting for our “Ok, I agree”.

If this happens to you in a single server there is no problem, but if you planned using pstools in more than 50 server, it’s a PITA executing grafically one by one, all servers and all tools, to accept the EULA.

Neither the tools “help”, nor the official documentation shows any way to get rid of this. But in a website (that I’ve lost, so I can’t credit them accordingly, sorry) I’ve found an undocumented feature: /accepteula

Just add this parameter to your scripts, and accepting EULA won’t give you any more problems. For instance:

winexe -U HOME/Administrator%Pass123 //host "d:scriptspstoolspslist.exe /accepteula"

This way you can make a ps in any server without worrying if it’s the first time you use pslist or not.

SAMBA and special characters (accents, ñ…)

Normally you don’t use strange characters in filenames – you don’t want problems. But this doesn’t mean it can’t be done, neither we should avoid it. In fact, applications like Word uses the first line of the document (the title) to suggest a default filename to the user, so if title has accents, so will filename…

Unfortunately, SAMBA doesn’t seem to be prepared to show this filenames by default, and substitutes them with an underscore (“_”), so we should change the configuration this way:

SAMBA as a client: that is, when you want to reach remote files from your linux box.

Long ago, when we used SMB driver with mount, we should use option “nls=utf8”:

mount -t smb //REMOTE/shared /mnt/remote/shared -o credentials=FILE,nls=utf8

Now, CIFS driver (the one that substitutes SMB driver because it’s totally obsolete) is prepared by default, so there’s no need:

mount -t cifs //REMOTE/shared /mnt/remote/shared -o credentials=FILE

After that, you can be confident and do a touch /mnt/remote/shared/tomàs_núñez.txt , and the file will be created without problems.

SAMBA as a server: that is, when we want to share our linux documents to other machines.
In this case we should add two lines to config file smb.conf (usually /etc/samba/smb.conf):

dos charset = 850
unix charset = ISO8859-15

This way, files will be shared with accents in filenames, ñ and so on!