Recently, I tried to configure Cygwin SSH to use Pageant. No big issue, just launch the Cygwin installer, and look for package named ssh-pageant
After installation, execute Pageant on your Windows computer, and load the required SSH key
Then in your Cygwin terminal, execute the following command:
$ `ssh-pageant`
Make sure the backtick is included in the command
Then try to SSH to your server using the command
$ ssh -A root@yourserver.com
If you are getting a password prompt, you are facing the same problem that I got.
The main issue here is the version of SSH included in latest Cygwin is version 7 or higher. Version 7 have deprecated the support for ssh-dss, which is used by Puttygen
To check if you are indeed being restricted to use ssh-dss key, SSH again to your server, but this time add "v" to the option so that you can see what happening during the connection:
$ ssh -Av root@yourserver.com
You will see this line:
debug1: Skipping ssh-dss key imported-openssh-key for not in PubkeyAcceptedKeyTypes
To overcome this issue, just create a file call config in ~/.ssh
$ touch ~/.ssh/config
Edit the content of the file to include this line:
Host *
PubkeyAcceptedKeyTypes +ssh-dss
Try to SSH to your server again, you should now be able to login without any prompt asking for password, as the key required is being supplied by Pageant.
Hope this solve your problem.
Reference for this issue was obtained from: http://blog.ayrtonaraujo.net/2015/09/using-openssh-7-0-with-legacy-ssh-implementations/
Showing posts with label cygwin. Show all posts
Showing posts with label cygwin. Show all posts
Tuesday, 20 October 2015
Thursday, 22 August 2013
Howto: Extract all email address from Google Contacts
Let's say you want to extract all email address from your contacts in Google Contacts, and export it somewhere else. Yes you can just export the CSV file, and then upload. The other service will do the import and cleanup for you. But, if you just want to share the email address, why give them other info that they are not suppose to have?
OK. Here are the steps to only extract email address using command line. I'm using Cygwin, but it should be similar if you are using Linux or other Unix-based operating system.
Follow this steps:
1. Select Contacts in Gmail
2. Your contacts will be shown. Click More > Export
3. Select All Contacts and Google CSV format, then click Export
4. Save the file somewhere. I save it in C:\google.csv . If you are using Cygwin, the file is accessible using the path \cygdrive\c\google.csv
5. Now come the interesting part, to extract the email address. The data is separated by comma, and we don't really know which column holds the email address. So we must iterate all column, and extract anything that resembles an email address. Here is the command:
$ grep @ google.csv | awk -F, '{for(i=1;i<=NF;i++) if ($i ~ /@.*\./) {printf "%s\n", $i};}' | awk -F" ::: " '{for (i=1;i<=NF;i++) {print $i};}' |sort |uniq
6. Let's break the command apart
7. grep @ google.csv
This command will get line that contain "@" character. The result is lines that contain "@", with multiple column, separated by comma ","
8. awk -F, '{for(i=1;i<=NF;i++) if ($i ~ /@.*\./) {printf "%s\n", $i};}'
This command let awk know that the field separator is comma (-F,). It will loop through all the field (for(i=1;i<=NF;i++)). If that field match an email pattern ($i ~ /@.*\./), it will print that field.
9. awk -F" ::: " '{for (i=1;i<=NF;i++) {print $i};}'
Some of the field will have multiple email address separated by " ::: ", because it groups the email address together. This command will split the field using " ::: " separator (-F" ::: ") then loop through each field, and print each of them
10. sort
This command will sort the output
11. uniq
This command will remove any duplicates.
12. In the end you will get a list of emails. But, you must understand that the output might not be 100% clean. Some of your contact might put their email with their name, or the note area of your contact might contain additional information that resembles email. You need to clean up your output, but the effort will be small.
OK. Here are the steps to only extract email address using command line. I'm using Cygwin, but it should be similar if you are using Linux or other Unix-based operating system.
Follow this steps:
1. Select Contacts in Gmail
2. Your contacts will be shown. Click More > Export
3. Select All Contacts and Google CSV format, then click Export
4. Save the file somewhere. I save it in C:\google.csv . If you are using Cygwin, the file is accessible using the path \cygdrive\c\google.csv
5. Now come the interesting part, to extract the email address. The data is separated by comma, and we don't really know which column holds the email address. So we must iterate all column, and extract anything that resembles an email address. Here is the command:
$ grep @ google.csv | awk -F, '{for(i=1;i<=NF;i++) if ($i ~ /@.*\./) {printf "%s\n", $i};}' | awk -F" ::: " '{for (i=1;i<=NF;i++) {print $i};}' |sort |uniq
6. Let's break the command apart
7. grep @ google.csv
This command will get line that contain "@" character. The result is lines that contain "@", with multiple column, separated by comma ","
8. awk -F, '{for(i=1;i<=NF;i++) if ($i ~ /@.*\./) {printf "%s\n", $i};}'
This command let awk know that the field separator is comma (-F,). It will loop through all the field (for(i=1;i<=NF;i++)). If that field match an email pattern ($i ~ /@.*\./), it will print that field.
9. awk -F" ::: " '{for (i=1;i<=NF;i++) {print $i};}'
Some of the field will have multiple email address separated by " ::: ", because it groups the email address together. This command will split the field using " ::: " separator (-F" ::: ") then loop through each field, and print each of them
10. sort
This command will sort the output
11. uniq
This command will remove any duplicates.
12. In the end you will get a list of emails. But, you must understand that the output might not be 100% clean. Some of your contact might put their email with their name, or the note area of your contact might contain additional information that resembles email. You need to clean up your output, but the effort will be small.
Subscribe to:
Posts (Atom)


