Category: Cygwin


After a fresh install of cygwin, you may have some trouble with your locale settings. For instance, while running cpan -l to look for installed Perl modules, I had this error message :

fool@localhost:~$ cpan -l

perl: warning: Please check that your locale settings:   LC_ALL = (unset),   LANG = “”  are supported and installed on your system.

To check which locales are available on your system :

fool@localhost:~$ locale -a

To set the correct value for your locale settings :

fool@localhost:~$ export LC_ALL=en_US.utf8

This will be only available for your current xterm session. To make it available all the time, set it into your shell profile configuration file.

In order not to type your passphrase everytime you connect to a server using ssh, put the code below in your own bashrc file :

SSHAGENT=/usr/bin/ssh-agent

SSHAGENTARGS=”-s”

if [ -z "$SSH_AUTH_SOCK" -a -x "$SSHAGENT" ]; then

eval `$SSHAGENT $SSHAGENTARGS`

trap “kill $SSH_AGENT_PID” 0

fi
Then reload your shell configuration by issuing the following command : source .bashrc

You will be asked to type once your passphrase and that’s it ! If you use keys-based authentication, do not forget to copy your public key to the servers you often connect to with the utility ssh-copy-id! ssh-agent will be very useful for you !

In order to make the connections to several servers through SSH easier, I use public/private keys-based authentication.

Cygwin provides all the basic tools related to SSH : ssh client, ssh-keygen, ssh-copy-id, ssh-add and ssh-agent.

Once I created my DSA keys with a passphrase, I sent my public key to all the involved servers with the ssh-copy-id utility.  So, each time I connect to a server, I only have to type my passphrase. It is possible to avoid it by using ssh-agent.

To start it : exec ssh-agent /usr/bin/bash

If you do not use exec, you will get the following error message :

Could not open a connection to your authentication agent

To add your DSA identity to your authentication agent : ssh-add ~/.ssh/id_dsa

Type your passphrase once and then, you will not need to type it anymore. You will be able to connect to servers where you have uploaded your public key.

This solution works only for your current xterm. If you open a new xterm session, you will have to type your passphrase.

If you manage remote servers with Putty, the following tips may help you in your daily tasks :

Putty Session Manager

Putty Connection Manager


Some Cygwin tips (1)

Please find below some Cygwin tips. You can launch the following commands from a MS-DOS shell providing that PATH contains the full path to Cygwin’s binaries.

–> how to open a Windows Application from shell

cygstart report.doc (calls word)

cygstart . (Open explorer)

cygstart / (Open explorer)

cygstart -x . (Open explorer)

–>Launch Internet Explorer with a given url

cygstart http://www.cygwin.com

–>Display the content of a README file into Notepad

cygstart –print README.txt

Follow

Get every new post delivered to your Inbox.