Project and Portfolio Management Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Using Cygwin bash to start windows/application services remotely

SOLVED
Go to solution
Highlighted
pradeep k.r.
Super Collector

Using Cygwin bash to start windows/application services remotely

All,

We've a requirement to use the Cygwin client locally to start/stop application services hosted on a remote server. We've the cygwin tool installed on server and the necessary scripts used to config/deploy/start/stop PPM services. I've gone ahead and installed cygwin locally. Now I need to use this as local windows service to connect to remote server & use it as rdp.

Is there any proper way of setting this up? as I understand cygwin needs to have sshd configured to communicate to remote host.

Your help is much appreciated.

Thanks,
Pradeep
8 REPLIES
pradeep k.r.
Super Collector

Re: Using Cygwin bash to start windows/application services remotely

Dear PPM'ers,

I do understand that we could run remote applications/programs hosted on servers through cygwin bash. This means open ssh needs to be installed during the package selection. Also this needs to have sshd configured for secure remote access. Does anyone have experience/have tried remotely controlling PPM services (deploy,start,stop etc.,). If so kindly lead us on this.

Thanks
Solution

Re: Using Cygwin bash to start windows/application services remotely

Hi,

as far as I have understood your requirment you want to stop/start a ppm service hosted on a remote windows box.

There are more than one way:
1.) run the build-in windows command sc from the local command line i.g. in a request type command:
ksc_local_exec sc \\ stop
run sc --help for a complete list
The user running this command must be member of the admin group of the remote server.
No ssh is needed but both ppm server must be on windows.
2.) Install sshd on the remote server (can be very tricky)
Open a connection with ssh
Logon as administrator
run the windows command net stop
3.) Install sshd on the remote server
Open a connection with ssh
Logon as administrator
run the cygwin tool cygrunsrv
4.) Install sshd on the remote server
Open a connection with ssh
Logon as administrator
change to /bin dir
run sh kStop.sh
5.) Use microsofts powershell
6.) If your security requirements are low:
Install the build-in telnet server of windows instead of the ssh server

Regards
Volker
pradeep k.r.
Super Collector

Re: Using Cygwin bash to start windows/application services remotely

Hi Volker,

Thanks for your feedback. Yes, we need to be able to run the config,deploy,start,stop & run other scripts vide the cygwin bash locally for the services hosted on a remote windows server.Since we're going to lose direct access to this server.

So just to clarify, if we're able to install SSHD on the remote server & connect vide the cygwin bash, After connecting ,we can then change to the directory specified for PPM on remote m/c (Ex:: F:/PPM_Home/Bin) & run the scripts from there. Please clarify on this. Do we connect as the admin (user is a domain user & added to admin group). Please clrify on this aspect too.


Thanks A lot,
Pradeep

Re: Using Cygwin bash to start windows/application services remotely

Hi Pradeep,

yes, after installation of the SSHD you can connect to the remote server with a ssh client
and run scripts.
You can configure the cygwin SSHD to logon with domain users.
However this is hard configuration work and finally I never get it really working.
When even possible use local users rather than domain users.
Depending on the scripts you want to run, the user must be member of the local admin group or not.
For PPM scripts admin rights should not be needed but the user must have full rights on the PPM_HOME and all subdirs.
Search the I-Net there are tons of how to's for configuring SSHD with cygwin.

Regards
Volker
pradeep k.r.
Super Collector

Re: Using Cygwin bash to start windows/application services remotely

Hi Volker,

Thanks a lot!! I've now setup SSHD and successfully configured it as windows service using the local system account. It has the sshd listening on port 22. Now I'm able to connect using cygwin running "ssh -V localhost" or ssh localhost.

I've problems in connecting to remote m/c vide ssh. Also I've added the user to the /etc/passwd/ & /etc/group/. How Do I make a successful connection to this remote server //g4w0813g.houston.hp.com to access the application services?? Am I still missing things here? Do I need to setup SSHD on remot e m/c & generate the RSA keys with the user setup there.

I checked the url's concerning configuring sshd for cygwin.

Thanks,
Pradeep

Re: Using Cygwin bash to start windows/application services remotely

Hi Pradeep,

you need a ssh client on your PC.
Cygwin includes a ssh client.
Copy the cygwin dir to your computer and add the path to the PATH environment variable.
Open a command line and run ssh

Or search the I-Net for the tool putty.
It is a freeware ssh client.

When you have the requirement for transfering files from/to this server using scp search for the tool winscp.
It is a norton commander style scp client

Regards
Volker
Jim Esler
Honored Contributor

Re: Using Cygwin bash to start windows/application services remotely

You can connect to a server via ssh or scp only if that server is running sshd.
pradeep k.r.
Super Collector

Re: Using Cygwin bash to start windows/application services remotely

Thanks Eric/Volker, I'm trying to get this setup. Will get back if I need more help!!
//Add this to "OnDomLoad" event