Re: How to get a script file to use bash and ssh

2010-09-11 Thread Michael Ludwig
PaulHR schrieb am 02.09.2010 um 12:10 (-0700):
 
 I want to create script files that are not bound to my user id.  I
 want to create over 20 different scripts files, one for each server I
 manage.  I have uploaded keys to each server.  So all I should have to
 is enter is the ssh command 

Sounds like you want to explore what options ~/.ssh/config has:

  Host s22
HostName server-22.bla.rz
User superadmin

Then type:

  ssh s22

Same mechanism available for PuTTY.
-- 
Michael Ludwig

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: How to get a script file to use bash and ssh

2010-09-03 Thread Andrey Repin
Greetings, Jeremy Bopp!

 Assuming, of course, that the necessary entry in /etc/passwd is set
 correctly.

Even if not.
Or not set.

$ grep $USER /etc/passwd
[...]:/cygdrive/c/home/Daemon:/bin/bash

$ ls -l /cygdrive/c/home/Daemon
ls: cannot access /cygdrive/c/home/Daemon: No such file or directory

$ set | grep HOME
HOME=/c/home/Daemon
HOMEDRIVE=C:
HOMEPATH=/home/Daemon

$ ls -l $HOME
total 8015
drwxr-xr-x 1 Daemon Отсутствует   0 2010-08-29 19:21 Application Data
...

 The OP sounds pretty green and may have a different idea of
 his home directory's location than Cygwin deduces, so a little extra
 hand holding may be in order. :-)

May be... but it seems, that cygwin deduction is pretty accurate.


--
WBR,
 Andrey Repin (anrdae...@freemail.ru) 03.09.2010, 13:41

Sorry for my terrible english...


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: How to get a script file to use bash and ssh

2010-09-03 Thread Jeremy Bopp
On 9/3/2010 4:50 AM, Andrey Repin wrote:
 Greetings, Jeremy Bopp!
 
 Assuming, of course, that the necessary entry in /etc/passwd is set
 correctly.
 
 Even if not.
 Or not set.
 
 $ grep $USER /etc/passwd
 [...]:/cygdrive/c/home/Daemon:/bin/bash
 
 $ ls -l /cygdrive/c/home/Daemon
 ls: cannot access /cygdrive/c/home/Daemon: No such file or directory
 
 $ set | grep HOME
 HOME=/c/home/Daemon
 HOMEDRIVE=C:
 HOMEPATH=/home/Daemon
 
 $ ls -l $HOME
 total 8015
 drwxr-xr-x 1 Daemon Отсутствует   0 2010-08-29 19:21 Application Data
 ...
 
 The OP sounds pretty green and may have a different idea of
 his home directory's location than Cygwin deduces, so a little extra
 hand holding may be in order. :-)
 
 May be... but it seems, that cygwin deduction is pretty accurate.

After looking at it in more detail, I agree that you're most likely
correct.  Since the OP isn't asking more questions about this, I guess
things are working for him in any case.

-Jeremy

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



How to get a script file to use bash and ssh

2010-09-02 Thread PaulHR

I want to create script files that are not bound to my user id.  I want to
create over 20 different scripts files, one for each server I manage.  I
have uploaded keys to each server.  So all I should have to is enter is the
ssh command 


I have put in a file called MyOpenUp.bat the following... 



ssh {myserve...@myserverhostname}




I have put that command in a file called MyOpenUp.init


I have created a MyOpenUp.bat file with the following



@echo off


C:

chdir C:\cygwin\bin

bash --init-file MyOpenUp.init -i -l




While the shell opens up all I get is

cygwi...@localhostname ~

$



I am a cygwin newbie.  I am sure it is me not understanding the man page
correctly.  What am I doing wrong?  The Documentation did not help either.

TIA



-- 
View this message in context: 
http://old.nabble.com/How-to-get-a-script-file-to-use-bash-and-ssh-tp29608117p29608117.html
Sent from the Cygwin list mailing list archive at Nabble.com.


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: How to get a script file to use bash and ssh

2010-09-02 Thread Jeremy Bopp
On 9/2/2010 2:10 PM, PaulHR wrote:
 
 I want to create script files that are not bound to my user id.  I want to
 create over 20 different scripts files, one for each server I manage.  I
 have uploaded keys to each server.  So all I should have to is enter is the
 ssh command 
 
 
 I have put in a file called MyOpenUp.bat the following... 
 
 
 
 ssh {myserve...@myserverhostname}
 
 
 
 
 I have put that command in a file called MyOpenUp.init
 
 
 I have created a MyOpenUp.bat file with the following
 
 
 
 @echo off
 
 
 C:
 
 chdir C:\cygwin\bin
 
 bash --init-file MyOpenUp.init -i -l
 
 
 
 
 While the shell opens up all I get is
 
 cygwi...@localhostname ~
 
 $

It looks like you are trying to effectively create one shortcut per
remote host which you can run and automatically have it open an ssh
session to that host using a particular user specific to that host.  Is
that a correct assessment?

-Jeremy

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: How to get a script file to use bash and ssh

2010-09-02 Thread PaulHR

Yes, that is correct.



Jeremy Bopp-3 wrote:
 
 On 9/2/2010 2:10 PM, PaulHR wrote:
 
 I want to create script files that are not bound to my user id.  I want
 to
 create over 20 different scripts files, one for each server I manage.  I
 have uploaded keys to each server.  So all I should have to is enter is
 the
 ssh command 
 
 
 I have put in a file called MyOpenUp.bat the following... 
 
 
 
 ssh {myserve...@myserverhostname}
 
 
 
 
 I have put that command in a file called MyOpenUp.init
 
 
 I have created a MyOpenUp.bat file with the following
 
 
 
 @echo off
 
 
 C:
 
 chdir C:\cygwin\bin
 
 bash --init-file MyOpenUp.init -i -l
 
 
 
 
 While the shell opens up all I get is
 
 cygwi...@localhostname ~
 
 $
 
 It looks like you are trying to effectively create one shortcut per
 remote host which you can run and automatically have it open an ssh
 session to that host using a particular user specific to that host.  Is
 that a correct assessment?
 
 -Jeremy
 
 --
 Problem reports:   http://cygwin.com/problems.html
 FAQ:   http://cygwin.com/faq/
 Documentation: http://cygwin.com/docs.html
 Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
 
 
 

-- 
View this message in context: 
http://old.nabble.com/How-to-get-a-script-file-to-use-bash-and-ssh-tp29608117p29608244.html
Sent from the Cygwin list mailing list archive at Nabble.com.


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: How to get a script file to use bash and ssh

2010-09-02 Thread Heath Kehoe

 On 9/2/2010 2:10 PM, PaulHR wrote:

I want to create script files that are not bound to my user id.  I want to
create over 20 different scripts files, one for each server I manage.  I
have uploaded keys to each server.  So all I should have to is enter is the
ssh command


I have put in a file called MyOpenUp.bat the following...



ssh {myserve...@myserverhostname}




I have put that command in a file called MyOpenUp.init


I have created a MyOpenUp.bat file with the following



@echo off


C:

chdir C:\cygwin\bin

bash --init-file MyOpenUp.init -i -l





That's all more complicated than it needs to be. Just make windows 
shortcuts to c:\cygwin\bin\ssh.exe, where Start in: is set to 
c:\cygwin\bin, and modify Target: to contain C:\cygwin\bin\ssh.exe 
usern...@hostname (without the quotes of course).


Better yet, install mintty if you don't already have it, and set the 
shortcuts' target to: C:\cygwin\bin\mintty.exe -e /bin/ssh 
usern...@hostname


(Mintty is a much better term window than cmd.)

-heath


__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: How to get a script file to use bash and ssh

2010-09-02 Thread Jeremy Bopp
On 9/2/2010 2:36 PM, Heath Kehoe wrote:
  On 9/2/2010 2:10 PM, PaulHR wrote:
 That's all more complicated than it needs to be. Just make windows
 shortcuts to c:\cygwin\bin\ssh.exe, where Start in: is set to
 c:\cygwin\bin, and modify Target: to contain C:\cygwin\bin\ssh.exe
 usern...@hostname (without the quotes of course).
 
 Better yet, install mintty if you don't already have it, and set the
 shortcuts' target to: C:\cygwin\bin\mintty.exe -e /bin/ssh
 usern...@hostname
 
 (Mintty is a much better term window than cmd.)

I was going to suggest much the same things to start; however, there
could be issues with home directory settings (necessary for locating the
private ssh keys).  It might also be good to eventually work in the ssh
agent so that the need for passwords can be reduced.

BTW, if you only need Cygwin for connecting to remote hosts with SSH,
you might find Putty to be a better fit for your needs.

-Jeremy

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: How to get a script file to use bash and ssh

2010-09-02 Thread Andy Koppe
On 2 September 2010 20:52, Jeremy Bopp wrote:
 That's all more complicated than it needs to be. Just make windows
 shortcuts to c:\cygwin\bin\ssh.exe, where Start in: is set to
 c:\cygwin\bin, and modify Target: to contain C:\cygwin\bin\ssh.exe
 usern...@hostname (without the quotes of course).

 Better yet, install mintty if you don't already have it, and set the
 shortcuts' target to: C:\cygwin\bin\mintty.exe -e /bin/ssh
 usern...@hostname

 (Mintty is a much better term window than cmd.)

 I was going to suggest much the same things to start; however, there
 could be issues with home directory settings (necessary for locating the
 private ssh keys).  It might also be good to eventually work in the ssh
 agent so that the need for passwords can be reduced.

That shouldn't be an issue, because HOME, if not set already, is set
automatically based on the user's /etc/passwd entry or the Windows
HOMEDRIVE and HOMEPATH variables when the initial Cygwin process is
started.

Andy

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: How to get a script file to use bash and ssh

2010-09-02 Thread Jeremy Bopp
On 9/2/2010 3:31 PM, Andy Koppe wrote:
 On 2 September 2010 20:52, Jeremy Bopp wrote:
 That's all more complicated than it needs to be. Just make windows
 shortcuts to c:\cygwin\bin\ssh.exe, where Start in: is set to
 c:\cygwin\bin, and modify Target: to contain C:\cygwin\bin\ssh.exe
 usern...@hostname (without the quotes of course).

 Better yet, install mintty if you don't already have it, and set the
 shortcuts' target to: C:\cygwin\bin\mintty.exe -e /bin/ssh
 usern...@hostname

 (Mintty is a much better term window than cmd.)

 I was going to suggest much the same things to start; however, there
 could be issues with home directory settings (necessary for locating the
 private ssh keys).  It might also be good to eventually work in the ssh
 agent so that the need for passwords can be reduced.
 
 That shouldn't be an issue, because HOME, if not set already, is set
 automatically based on the user's /etc/passwd entry or the Windows
 HOMEDRIVE and HOMEPATH variables when the initial Cygwin process is
 started.

Assuming, of course, that the necessary entry in /etc/passwd is set
correctly.  The OP sounds pretty green and may have a different idea of
his home directory's location than Cygwin deduces, so a little extra
hand holding may be in order. :-)

-Jeremy

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple