Pages: 1 [2]   Go Down
Author Topic: Installation problems (Server on Windows) -- NOT SUPPORTED  (Read 916 times)
0 Members and 3 Guests are viewing this topic.
Crazybest
Jr. Member
**

Karma: 0
Offline Offline

Posts: 13


View Profile
« Reply #15 on: September 26, 2006, 10:05:44 AM »

ok, i installed the cygwin- openssh.

ssh -v localhost ==> works

connecting from win xp (where pandora_agent is installed) with putty on ssh of server ==> works

C:\pandora\bin>pandoraagent --test-ssh ==> doesn't work

[code:1]C:\pandora\bin>pandoraagent --test-ssh
Public key file: C:\pandora\bin\key\id_dsa.pub
Private key file: C:\pandora\bin\key\id_dsa
Connecting with 10.0.0.4...
Authentication Failed when connecting to 10.0.0.4
Check the remote host configuration and the public/private key files.
[/code]

i have tried to get the keys right.. i copied the keys in the [server w2003]c:\cygwig\home\<username>\ folder to the [client wxp]c:\pandora\bin\key folder.

with putty i tried to make some new keys (ssh-keygen -t dsa, copied those and renamed to id_dsa; but it didnt work out)


i will be waiting for your response. thanks a lot again and again and again :)
« Last Edit: January 01, 1970, 01:00:00 AM by Crazybest » Logged

raul
Administrator
Expert member
*****

Karma: 1
Offline Offline

Posts: 576



View Profile
« Reply #16 on: September 26, 2006, 10:55:13 AM »

To connect directly you have to add to the .ssh folder in the profile directory of the user which runs SSH Server the file authorized_keys, when you'll add the public keys (in cygwin)

[code:1]cat C:\pandora_agent\bin\key\id_dsa.pub >> /home/pandora/.ssh/authorized_keys[/code]

(this is only for concept, the command, on command line interpreter of iwndows will be something like):

[code:1]type C:\pandora_agent\bin\key\id_dsa.pub >> C:\cygwin\home\pandora\.ssh\authorized_keys[/code]

At this moment I don't know if I can help you more :-D, as I told you, setting this in GNU/Linux is far easier... I don't know why you're still using Win* :-D

Raúl

EDIT: Changed all reference from %..USER..% to pandora and added a true command line :-D
« Last Edit: September 29, 2006, 03:25:06 PM by raul » Logged

Crazybest
Jr. Member
**

Karma: 0
Offline Offline

Posts: 13


View Profile
« Reply #17 on: September 26, 2006, 11:46:42 AM »

Quote from: "raul"
To connect directly you have to add to the .ssh folder in the profile directory of the user which runs SSH Server the file authorized_keys, when you'll add the public keys: do something like

[code:1]type C:\pandora\bin\key\id_dsa.pub >> %HOME_SSHD_USER%/.ssh/authorized_keys[/code]

Do also (who knows which kind of version it uses :-D):

[code:1]type C:\pandora\bin\key\id_dsa.pub >> %HOME_SSHD_USER%/.ssh/authorized_keys2[/code]

Where %HOME_SSHD_USER% is the profile directory of the user that runs OpenSSH.

At this moment I don't know if I can help you more :-D, as I told you, setting this in GNU/Linux is far easier... I don't know why you're still using Win* :-D

Raúl


Quote from: "Crazybest"
...

Where should i do that code?

My win2003 server, loginname is Administrator, so this is my pad:
win2003s: C:\cygwin\home\Administrator\.ssh\authorized_keys

but the agent isnt isntalled on this server, it is on win xp. so
winxp: C:\pandora\bin\key\id_dsa.pub

did i installed the openssh server on the wrong machine... should it be installed on the agent?..


PS:
i will make a picture to give an overview of my situation in a hour.


EDITTED:



Maybe you see some problems in here, or that you can give me better fittable scripts :).... thx in advance.
« Last Edit: January 01, 1970, 01:00:00 AM by Crazybest » Logged

raul
Administrator
Expert member
*****

Karma: 1
Offline Offline

Posts: 576



View Profile
« Reply #18 on: September 26, 2006, 04:16:25 PM »

Let's see. Your problem is the OpenSSH setup. I think you SHOULD read all the information carefully, but I'll try to give you an small idea:

0) First of all, I'll only talk about the localhost to localhost connection at the windows 2003 Server. The other is just the same agent, just changing the IP, and name in the agent.conf file.

1) Cygwin and Pandora Server, will be installed on the windows 2003 Server. Create here the user pandora on the operating System.

2) I suppose you have installed Cygwin, and installed as service, To Set up cygwin SSH, follow the instruction on the page I gave you and change the user to SYSTEM

[code:1]chown SYSTEM /etc/ssh_*
chown SYSTEM /var/log/sshd.log
chown -R SYSTEM /var/empty[/code]

Change permission:

[code:1]chmod 600 /etc/ssh_h*[/code]

As you have created the pandora user, you have to add it to cygwin env:

[code:1]mkpasswd.exe -u pandora -l >>/etc/passwd[/code]

Create home for the user:

[code:1]mkdir /home/pandora[/code]

Create /home/pandora/.ssh directory

Copy the key id_dsa.pub (this is the same as in the c:\pandora_agent\bin\key directory) file to /home/pandora/.ssh/authorized_keys:

(
EDIT: It's supposed that you have changed the mount point in cygwin, using command:

[code:1]mount -s --change-cygdrive-prefix /[/code]

if not, use /cygdrive/c/ instead /c/
)

[code:1]cat /c/pandora_agent/bin/key/id_dsa.pub >> /home/pandora/.ssh/authorized_keys[/code]

Change permission to that file:

[code:1]chmod 600 authorized_keys[/code]
Change permissions to .ssh directory:

[code:1]chmod 700 /home/pandora/.ssh[/code]

Change owner:

[code:1]chown -R pandora /home/pandora[/code]

Test Pandora Agent:

[code:1]>PandoraAgent.exe --test-ssh
Public key file: C:\pandora_agents\win32\bin\key\id_dsa.pub
Private key file: C:\pandora_agents\win32\bin\key\id_dsa
Connecting with 127.0.0.1...
Authentication successful.
Host fingerprint: 1F:F0:D7:41:B9:78:D5:5A:BE:3E:C6:E5:B1:82:7C:67
Created a blank XML file in C:\temp\ssh.test
Remote copying C:\temp\ssh.test on server 127.0.0.1 at /pandora_server/data_in/ssh.test
Successfuly file copied to remote host
Successfuly disconnected from remote host
The SSH test was successful!
[/code]

Well, at this moment, the OpenSSH Server and the connection between agent and server works.

Next: An small trick :-D. Let's create a link in the cygwin environment to receive data (as you can see at the pandora_agent.conf file, the directory
to set the file on the server is /opt/pandora_server/data_in, so we are going to create this, we suppose the server is installed on C:\pandora_server)

[code:1]mkdir /opt
cd /opt
ln -s -f /c/pandora_server pandora_server
[/code]
 
Now, start PandoraAgent Service.

Set the line
[code:1]checksum 0[/code]
at pandora_server.conf, to avoid the server wait for the .checksum files (at this moment we will not use the md5 checksum) and start Pandora Server.

This it's all!!! I have made all the changes by myself at the moment of writting and it works.. so it shouldn't have to be a problem.

Review all the logs to get more details about  any error.

To setup the agent in the other PC, just change Ip and name in the pandora_agent.conf file.

I think this is the last post about this issue. If somebody wants to make an step-by-step guide with this information, it's welcome :-D

Raúl

EDIT: I delete quoted text and changed some bad paths
« Last Edit: November 15, 2006, 09:04:10 PM by raul » Logged

raul
Administrator
Expert member
*****

Karma: 1
Offline Offline

Posts: 576



View Profile
« Reply #19 on: September 26, 2006, 04:21:40 PM »

One more thing:

You can see something in the standard exit:

[code:1]Use of uninitialized value in length at pandora_server.pl line 305.
Use of uninitialized value in length at pandora_server.pl line 306.
Use of uninitialized value in concatenation (.) or string at pandora_db.pm line 450.[/code]

This are not just errors, but notice text. Just ignore it, we'll try to change it before the new release :-D

Raul
« Last Edit: January 01, 1970, 01:00:00 AM by raul » Logged

Crazybest
Jr. Member
**

Karma: 0
Offline Offline

Posts: 13


View Profile
« Reply #20 on: September 28, 2006, 04:00:22 PM »

i will sum up my current situation

i followed your post, which made it impossible to do even pandoraagent --test-ssh. Prolly coz it missed one or several rights (chown/chmod) to receive the message.

after that i tried (with tips of mostly steve-o, marostegui and slerena via IRC) to restart sshd, which didnt went well, to restart (reinstall) cygwin) but in the end it still didnt worked well...

I have the feeling that sshd doesnt want to start, still coz of missing several rights. I dont know ..peep.. about ssh nor cygwin.
« Last Edit: January 01, 1970, 01:00:00 AM by Crazybest » Logged

raul
Administrator
Expert member
*****

Karma: 1
Offline Offline

Posts: 576



View Profile
« Reply #21 on: September 29, 2006, 08:59:56 AM »

Following the instruction I gave you, you'll have:

[code:1]bash-3.1$ pwd
/etc
bash-3.1$ ls -la ssh*
-rwxrwxrwx 1 SYSTEM mkpasswd 1353 Sep 21 18:23 ssh_config
-rw------- 1 SYSTEM mkpasswd  668 Sep  6 16:32 ssh_host_dsa_key
-rw------- 1 SYSTEM mkpasswd  606 Sep  6 16:32 ssh_host_dsa_key.pub
-rw------- 1 SYSTEM mkpasswd  979 Sep  6 16:32 ssh_host_key
-rw------- 1 SYSTEM mkpasswd  643 Sep  6 16:32 ssh_host_key.pub
-rw------- 1 SYSTEM mkpasswd 1675 Sep  6 16:32 ssh_host_rsa_key
-rw------- 1 SYSTEM mkpasswd  398 Sep  6 16:32 ssh_host_rsa_key.pub
-rw-rw-rw- 1 SYSTEM mkpasswd 2866 Sep 26 15:19 sshd_config
bash-3.1$ cd /var
bash-3.1$ ls -la
bash-3.1$ ls -la
total 0
drwxrwxrwx+  8 raul Users    0 Sep  6 16:42 .
drwxrwxrwx+ 11 raul Users    0 Sep 26 15:50 ..
drwxrwxrwx+  3 raul Users    0 Jul 19 12:00 cache
drwxr-xr-x+  2 SYSTEM  mkpasswd 0 Sep  6 16:42 empty
drwxrwxrwx+  3 raul Users    0 Jul 19 12:00 lib
drwxrwxrwx+  2 raul Users    0 Sep 26 15:58 log
drwxrwxrwx+  2 raul Users    0 Sep 26 18:01 run
drwxrwxrwx+  2 raul Users    0 Jul 19 11:52 tmp
bash-3.1$ ls -la empty/
total 0
drwxr-xr-x+ 2 SYSTEM  mkpasswd 0 Sep  6 16:42 .
drwxrwxrwx+ 8 raul Users    0 Sep  6 16:42 ..
bash-3.1$ ls -la log
total 517
drwxrwxrwx+ 2 raul Users               0 Sep 26 15:58 .
drwxrwxrwx+ 8 raul Users               0 Sep  6 16:42 ..
-rw-rw-rw-  1 raul mkpasswd            0 Sep  6 16:32 lastlog
-rwxrwxrwx+ 1 raul Users          527828 Sep 13 12:47 setup.log.full
-rw-r--r--  1 SYSTEM  Administrators    110 Sep 26 17:02 sshd.log
bash-3.1$ cd /etc
bash-3.1$ tail -1 passwd
pandora:unused_by_nt/2000/xp:1:513:pandora_demo,U-EDDIE\pandora,S-1-5-21-2157
488890-195784573-2809259899-1021:/home/pandora:/bin/bash
bash-3.1$ cd /home
bash-3.1$ ls -la
total 0
drwxrwxrwx+  4 raul mkpasswd 0 Sep 26 15:28 .
drwxrwxrwx+ 11 raul Users    0 Sep 26 15:50 ..
drwxrwxrwx+  3 raul mkpasswd 0 Sep 21 18:06 raul
drwxrwxrwx+  3 pandora mkpasswd 0 Sep 26 15:28 pandora
bash-3.1$ cd pandora
bash-3.1$ ls -la
total 0
drwxrwxrwx+ 3 pandora mkpasswd 0 Sep 26 15:28 .
drwxrwxrwx+ 4 raul mkpasswd 0 Sep 26 15:28 ..
drwx------+ 2 pandora mkpasswd 0 Sep 26 17:01 .ssh
bash-3.1$ cd .ssh/
bash: cd: .ssh/: Permission denied
bash-3.1$ chmod 777 .ssh
bash-3.1$ ls -la
total 0
drwxrwxrwx+ 3 pandora mkpasswd 0 Sep 26 15:28 .
drwxrwxrwx+ 4 raul mkpasswd 0 Sep 26 15:28 ..
drwxrwxrwx+ 2 pandora mkpasswd 0 Sep 26 17:01 .ssh
bash-3.1$ cd .ssh/
bash-3.1$ ls -la
total 9
drwxrwxrwx+ 2 pandora mkpasswd   0 Sep 26 17:01 .
drwxrwxrwx+ 3 pandora mkpasswd   0 Sep 26 15:28 ..
-rw-------  1 pandora mkpasswd 606 Sep 26 13:33 authorized_keys
bash-3.1$ cd ..
bash-3.1$ chmod 700 .ssh
bash-3.1$ ls -la
total 0
drwxrwxrwx+ 3 pandora mkpasswd 0 Sep 26 15:28 .
drwxrwxrwx+ 4 u094596 mkpasswd 0 Sep 26 15:28 ..
drwx------+ 2 pandora mkpasswd 0 Sep 26 17:01 .ssh
[/code]

At services Control Panel, the Cygwin Service had to be inited as Local System Account.

Verify it: regedit
go to
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\sshd

ObjectName LocalSystem

go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\sshd\Parameters\Environment

You'll see

CYGWIN binmode ntsec tty


Let's go to MSDOS:

As you can see, I don't have anything at the Pandora user folder:

[code:1]
C:\Documents and Settings\pandora> ls -la
total 0
drwxrwxrwx   1 user     group           0 Sep 26 15:30 .
drwxrwxrwx   1 user     group           0 Sep 28 18:43 ..
[/code]

Init service:
[code:1]
net start sshd
The CYGWIN sshd service is starting.
The CYGWIN sshd service was started successfully.
[/code]

The Pandora Agent:

[code:1]
C:\SVN\pandora\trunk\pandora_agents\win32\bin>dir
 El volumen de la unidad C es System
 El número de serie del volumen es: 3595-2F52

 Directorio de C:\SVN\pandora\trunk\pandora_agents\win32\bin

28/09/2006  19:25    <DIR>          .
28/09/2006  19:25    <DIR>          ..
21/09/2006  18:00    <DIR>          key
06/07/2006  15:55           831.488 libeay32.dll
20/09/2006  15:49         5.432.664 PandoraAgent.exe
28/09/2006  19:25             2.307 pandora_agent.conf
27/09/2006  20:06             2.301 pandora_agent.old
20/09/2006  19:58             1.854 README
06/07/2006  15:55    <DIR>          util
06/07/2006  15:55            74.752 zlib1.dll
               6 archivos      6.345.366 bytes
               4 dirs  30.851.489.792 bytes libres

C:\SVN\pandora\trunk\pandora_agents\win32\bin>cd key

C:\SVN\pandora\trunk\pandora_agents\win32\bin\key>dir
 El volumen de la unidad C es System
 El número de serie del volumen es: 3595-2F52

 Directorio de C:\SVN\pandora\trunk\pandora_agents\win32\bin\key

21/09/2006  18:00    <DIR>          .
21/09/2006  18:00    <DIR>          ..
26/09/2006  13:33               668 id_dsa
26/09/2006  13:33               606 id_dsa.pub
07/07/2006  09:02                 0 PUT_SSH_KEYS_HERE
               3 archivos          1.274 bytes
               2 dirs  30.851.489.792 bytes libres

C:\SVN\pandora\trunk\pandora_agents\win32\bin\key[/code]

The id_dsa.pub file is the same as the /home/pandora/.ssh/authorized_keys file

With this post, as a resume, I finish the CYGWIN-SSHD installation thread.

Raul
« Last Edit: January 01, 1970, 01:00:00 AM by raul » Logged

raul
Administrator
Expert member
*****

Karma: 1
Offline Offline

Posts: 576



View Profile
« Reply #22 on: November 15, 2006, 11:33:56 PM »

Well, after reading more mails and POSTs about the question. I'll try to write step by step the solution of adding the keys (it's written as a FAQ, http://pandora.sourceforge.net/en/print.php?sec=docs/faq_answers#q23 but it looks like nobody read it!)

 - First, use puttygen.exe (available at the .\util folder of your pandora_agent_for_windows directory)

 - Generate keys, SSH-2_DSA:



 - Press Generate :-D

 - Export key to OpenSSH key (Cygwin uses a port of OpenSSH):



 - We have no chosen password, so press YES:



 - Save it as c:\pandora_agent\keys\id_dsa:



 - Now let's copy the public key to clipboard:


 - and paste it as c:\pandora_agent\keys\id_dsa.pub, after that we'll copy add it at the /home/pandora/.ssh/authorized_keys file:



[code:1]
cat /c/pandora_agent/keys/id_dsa.pub > /home/pandora/.ssh/authorized_keys
[/code]

Please, review permissions, at the end, you should have:
[code:1]
drwx------+  pandora mkpasswd  .ssh
-rw-------   pandora mkpasswd authorized_keys
[/code]

NOTE
The private key, should be something like:

[code:1]-----BEGIN DSA PRIVATE KEY-----
MIIBugIBAAKBgQDTFcDxg.....
......
-----END DSA PRIVATE KEY-----
[/code]

and public key something like

[code:1]ssh-dss AAAAB3NzaC1k.........
[/code]

Raúl
« Last Edit: January 01, 1970, 01:00:00 AM by raul » Logged

Pages: 1 [2]   Go Up
Print
 
Jump to:  


SourceForge.net Logo  This site is monitored by Pandora FMS   ArticaST