try under dir .ssh or .ssh2
Main Topics
Browse All TopicsI am trying to create a public key in Cygwin so I can SFTP without entering password.
I have cwgwin load on my windows visa computer. I use it to login to linux server.
I was trying to create the public ket and they copy it to the server i SFTP to.
I did create the pubilc key so take look at the below output.
[~]$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/cygdrive/h/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /cygdrive/h/.ssh/id_rsa.
Your public key has been saved in /cygdrive/h/.ssh/id_rsa.pu
The key fingerprint is:
78:21:60:bc:26:7e:a4:99:ab
The key's randomart image is:
+--[ RSA 2048]----+
| .o . .o. |
| ... o.. |
| .o o . |
| . + = . E |
| . B o S |
| = .o o |
| o. . |
| .. . |
|oo. . |
+-----------------+
[~]$ ls -ltrF
total 43055
-rwxrwxrwx 1 etimrou ???????? 7582407 Sep 6 2008 kget.log*
-rw-rw-rw- 1 etimrou mkgroup-l-d 25405 Jul 6 11:58 moshell_install
-rw-rw-rw- 1 etimrou mkgroup-l-d 26437120 Jul 6 11:58 moshell.tar
-rwxrwxrwx 1 etimrou ???????? 9935777 Jul 9 16:34 moshell7.1t.zip*
drwxr-xr-x+ 6 etimrou mkgroup-l-d 12288 Jul 9 16:37 moshell/
-rwxrwxrwx 1 etimrou ???????? 954 Jul 31 22:17 sftp.txt*
drwxrwxrwx+ 4 etimrou mkgroup-l-d 4096 Aug 1 18:59 moshell_logfiles/
-rwxrwxrwx 1 etimrou ???????? 211 Aug 4 10:07 txsftp.txt*
-rw------- 1 etimrou mkgroup-l-d 404 Aug 4 10:53 csdcnsnsg@138.85.87.18
drwxrwxrwx+ 2 etimrou ???????? 16384 Aug 5 13:02 w321/
drwxrwxrwx+ 7 etimrou ???????? 0 Aug 5 13:31 old/
drwxrwxrwx+ 2 etimrou ???????? 8192 Aug 5 21:48 w322/
drwxrwxrwx+ 2 etimrou ???????? 0 Aug 6 08:08 txrun/
-rwxrwxrwx 1 etimrou ???????? 227 Aug 11 10:59 txrun.txt*
drwxrwxrwx+ 2 etimrou ???????? 8192 Aug 11 12:10 w327/
-rw-rw-rw- 1 etimrou mkgroup-l-d 0 Aug 12 09:30 runsftp.txt
drwxrwxrwx+ 2 etimrou ???????? 40960 Aug 12 09:37 W323/
[~]$
Now I don't know where to find it. Need help.
Below is how i normally login to server. I have to enter a port number in order to login.
ssh csdcnsnsg@138.85.87.18 -p 6667
password: 00bs4Lvu
My username is csdcnsnsg
password 00bs4Lvu
server 138.85.87.18
Below is how i SFTP to server.I have to enter a port number in order to login.
sftp -oPort=6660 csdcnsnsg@138.85.87.18
password 00bs4Lvu
My username is csdcnsnsg
password 00bs4Lvu
server 138.85.87.18
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Thanks,
I copy the files from the h drive and put them on my c drive. I also copied the id_rsa.pub to the server at .ssh. Then I did a cat id_rsa.pub >> .ssh/authorized_keys.
I login in by ssh csdcnsnsg@138.85.87.18 -p 6667 and didn't have to enter password.
I login in by sftp -oPort=6660 csdcnsnsg@138.85.87.18 and didn't have to enter password.
Could you help me make 3 bash script to the following listed below?
Creating a script to SFTP files to a server.
#!/bin/bash
sftp -oPort=6667 csdcnsnsg@138.85.87.18
cd tim
cd tx_w327
put iub*
exit
sftp -oPort=6662 csdcnsnsg@138.85.87.18
cd tim
cd tx_w327
put iub*
exit
sftp -oPort=6663 csdcnsnsg@138.85.87.18
cd tim
cd tx_w327
put iub*
exit
I like too Creating a script to get SFTP files from a server.
#!/bin/bash
sftp -oPort=6667 csdcnsnsg@138.85.87.18
cd tim
cd tx_w327
get iub*
exit
sftp -oPort=6662 csdcnsnsg@138.85.87.18
cd tim
cd tx_w327
get iub*
exit
sftp -oPort=6663 csdcnsnsg@138.85.87.18
cd tim
cd tx_w327
get iub*
exit
I like too Creating a script to get SFTP files from a server.
#!/bin/bash
ssh csdcnsnsg@138.85.87.18 -p 6667
cd tim
dos2unix txrun229.txt
./txrun2229.txt.
Exit
ssh csdcnsnsg@138.85.87.18 -p 6662
cd tim
dos2unix txrun229.txt
./txrun2229.txt.
Exit
ssh csdcnsnsg@138.85.87.18 -p 6663
cd tim
dos2unix txrun229.txt
./txrun2229.txt.
Exit
Could you help me make 3 bash script to the following listed below?
Creating a script to SFTP files to a server.
#!/bin/bash
sftp -oPort=6667 csdcnsnsg@138.85.87.18
cd tim
cd tx_w327
put rxtun6667.txt
exit
sftp -oPort=6662 csdcnsnsg@138.85.87.18
cd tim
cd tx_w327
put txrun6662.txt
exit
sftp -oPort=6663 csdcnsnsg@138.85.87.18
cd tim
cd tx_w327
put txrunn6663.txt
exit
I like too Creating a script to get SFTP files from a server.
#!/bin/bash
sftp -oPort=6667 csdcnsnsg@138.85.87.18
cd tim
cd tx_w327
get iub*
exit
sftp -oPort=6662 csdcnsnsg@138.85.87.18
cd tim
cd tx_w327
get iub*
exit
sftp -oPort=6663 csdcnsnsg@138.85.87.18
cd tim
cd tx_w327
get iub*
exit
I like too Creating a script to get SFTP files from a server.
#!/bin/bash
ssh csdcnsnsg@138.85.87.18 -p 6667
cd tim
dos2unix txrun229.txt
./txrun2229.txt.
Exit
ssh csdcnsnsg@138.85.87.18 -p 6662
cd tim
dos2unix txrun229.txt
./txrun2229.txt.
Exit
ssh csdcnsnsg@138.85.87.18 -p 6663
cd tim
dos2unix txrun229.txt
./txrun2229.txt.
Exit
Omarfarid,
Your script worked for move file to server and a made a few changes and it will also get files from server.
I still need to create one more script to login to server and run a few commands.
here is the file I created listed below.
I like too Creating a script to get SFTP files from a server.
#!/bin/bash
ssh csdcnsnsg@138.85.87.18 -p 6667 <<-END
cd tim
dos2unix txrun229.txt
txrun2229.txt
Exit
END
ssh csdcnsnsg@138.85.87.18 -p 6662 <<-END
cd tim
dos2unix txrun229.txt
txrun2229.txt
Exit
END
ssh csdcnsnsg@138.85.87.18 -p 6663 <<-END
cd tim
dos2unix txrun229.txt
txrun2229.txt
Exit
END
I am getting some error, take a look below.
[~/w327]$ ./txrunALL.txt
Pseudo-terminal will not be allocated because stdin is not a terminal.
/home/csdcnsnsg/.bashrc: line 49: rnc: command not found
dos2unix: converting file txrun229.txt to UNIX format ...
dos2unix: problems converting file txrun229.txt
-bash: line 3: txrun2229.txt: command not found
-bash: line 4: Exit: command not found
Pseudo-terminal will not be allocated because stdin is not a terminal.
/home/csdcnsnsg/.bashrc: line 49: ./rnc: Permission denied
dos2unix: converting file txrun229.txt to UNIX format ...
dos2unix: problems converting file txrun229.txt
-bash: line 3: txrun2229.txt: command not found
-bash: line 4: Exit: command not found
Pseudo-terminal will not be allocated because stdin is not a terminal.
/home/csdcnsnsg/.bashrc: line 49: rnc: command not found
dos2unix: converting file txrun229.txt to UNIX format ...
dos2unix: problems converting file txrun229.txt
-bash: line 3: txrun2229.txt: command not found
-bash: line 4: Exit: command not found
[~/w327]$
Can you help me on this?
thanks!
Tim
I changed the format but still can't fingure it out. can some help?
[~/w327]$ ./txrunALL.txt
Pseudo-terminal will not be allocated because stdin is not a terminal.
/home/csdcnsnsg/.bashrc: line 49: rnc: command not found
dos2unix: converting file txrun6667.txt to UNIX format ...
Pseudo-terminal will not be allocated because stdin is not a terminal.
/home/csdcnsnsg/.bashrc: line 49: ./rnc: Permission denied
dos2unix: converting file txrun6667.txt to UNIX format ...
dos2unix: problems converting file txrun6667.txt
[~/w327]$
Below is on my computer
$cat .bashrc
unset PROMPT_COMMAND
export PS1="\[\033[1m\][\w]\\$\[\
alias ls="ls -FX"
set -o notify
set -o ignoreeof
shopt -s cdspell
shopt -s cdable_vars
shopt -s checkhash
shopt -s checkwinsize
shopt -s sourcepath
shopt -s histappend
export PATH=$PATH:/home/etimrou/m
Below is on the remote server.
# Sample .bashrc for SuSE Linux
# Copyright (c) SuSE GmbH Nuernberg
# There are 3 different types of shells in bash: the login shell, normal shell
# and interactive shell. Login shells read ~/.profile and interactive shells
# read ~/.bashrc; in our setup, /etc/profile sources ~/.bashrc - thus all
# settings made here will also take effect in a login shell.
#
# NOTE: It is recommended to make language settings in ~/.profile rather than
# here, since multilingual X sessions would not work properly if LANG is over-
# ridden in every subshell.
# This might be helpful for Linux newbies who previously used DOS...
test -f /etc/profile.dos && . /etc/profile.dos
# Some applications read the EDITOR variable to determine your favourite text
# editor. So uncomment the line below and enter the editor of your choice :-)
#export EDITOR=/usr/bin/vim
#export EDITOR=/usr/bin/mcedit
# For some news readers it makes sense to specify the NEWSSERVER variable here
#export NEWSSERVER=your.news.serve
# If you want to use a Palm device with Linux, uncomment the two lines below.
# For some (older) Palm Pilots, you might need to set a lower baud rate
# e.g. 57600 or 38400; lowest is 9600 (very slow!)
#
#export PILOTPORT=/dev/pilot
#export PILOTRATE=115200
PATH=$PATH:./
PATH=$PATH:/home/eric/utra
PATH=$PATH:/home/eric/utra
PATH=$PATH:/home/eric/utra
export LD_LIBRARY_PATH=/home/eric
alias flow="/home/eric/utran_too
shopt -s cdspell
shopt -s cdable_vars
shopt -s checkhash
shopt -s checkwinsize
shopt -s sourcepath
shopt -s histappend
test -s ~/.alias && . ~/.alias
export PS1='[\t \h \w]\$ '
#export PS1='\[\e[0;33m\][\[\e[1;3
alias rnc="egrep -vi \"rbs|rxi|ATM|Iub\" /home/eric/utran_tools/mos
rnc
PATH=$PATH:/home/eric/eusj
alias top20="perl /home/eric/utran_tools/per
alias dcg="perl /home/eric/utran_tools/per
[12:05:06 lamoshell ~]$
Ok I realized, that I was trying the wrong commands.
The below script worked but it only login to the first port 6667 and not the other two ports.
Not sure why.
Here is my script listed below.
#!/bin/bash
ssh csdcnsnsg@138.85.87.18 -p 6667 <<-END
cd tim
./txrun6667.txt
exit
END
ssh csdcnsnsg@138.85.87.18 -p 6662 <<-END
cd tim
./txrun6667.txt
exit
END
ssh csdcnsnsg@138.85.87.18 -p 6662 <<-END
cd tim
./txrun6667.txt
exit
END
Here is what happen when I ran the script.
[~]$ ./txrunALL.txt
Pseudo-terminal will not be allocated because stdin is not a terminal.
/home/csdcnsnsg/.bashrc: line 49: rnc: command not found
./txrun6667.txt: line 2: cd: tim: No such file or directory
Sitefile = tx.txt. Number of sites = 12
Command = lh ru hwlog read; lgaevsoyulm 9d; dump list -a; lh all llog -v; cab; cvls; get 0
Timeout set to 20 minutes (default value)
Maximum number of parallel processes set to 10 (default value)
Logfiles stored in /home/csdcnsnsg/tim/tx_w32
##########################
>>>>> STARTED (pid)
** FINISHED (result) STATUS (started, finished, queue, running, sites running)
##########################
>>>>> iub_CLU5626 (28608) 1s 0f 11q 1r: iub_CLU5626
>>>>> iub_CLU5627 (28611) 2s 0f 10q 2r: iub_CLU5626 iub_CLU5627
>>>>> iub_CLU2494 (28614) 3s 0f 9q 3r: iub_CLU2494 iub_CLU5626 iub_CLU5627
>>>>> iub_CLU5645 (28641) 4s 0f 8q 4r: iub_CLU2494 iub_CLU5626 iub_CLU5627 iub_CLU5645
>>>>> iub_CLU5678 (28644) 5s 0f 7q 5r: iub_CLU2494 iub_CLU5626 iub_CLU5627 iub_CLU5645 iub_CLU5678
>>>>> iub_CLU5076 (28647) 6s 0f 6q 6r: iub_CLU2494 iub_CLU5076 iub_CLU5626 iub_CLU5627 iub_CLU5645 iub_CLU5678
>>>>> iub_CLU5082 (28650) 7s 0f 5q 7r: iub_CLU2494 iub_CLU5076 iub_CLU5082 iub_CLU5626 iub_CLU5627 iub_CLU5645 iub_CLU5678
>>>>> iub_CLU5099 (28652) 8s 0f 4q 8r: iub_CLU2494 iub_CLU5076 iub_CLU5082 iub_CLU5099 iub_CLU5626 iub_CLU5627 iub_CLU5645 iub_CLU5678
>>>>> iub_CLU5861 (28766) 9s 0f 3q 9r: iub_CLU2494 iub_CLU5076 iub_CLU5082 iub_CLU5099 iub_CLU5626 iub_CLU5627 iub_CLU5645 iub_CLU5678 iub_CLU5861
>>>>> iub_CLU5869 (28769) 10s 0f 2q 10r: iub_CLU2494 iub_CLU5076 iub_CLU5082 iub_CLU5099 iub_CLU5626 iub_CLU5627 iub_CLU5645 iub_CLU5678 iub_CLU5861 iub_CLU5869
** iub_CLU5869 (OK) 10s 1f 2q 9r: iub_CLU2494 iub_CLU5076 iub_CLU5082 iub_CLU5099 iub_CLU5626 iub_CLU5627 iub_CLU5645 iub_CLU5678 iub_CLU5861
>>>>> iub_CLU1616 (4797) 11s 1f 1q 10r: iub_CLU1616 iub_CLU2494 iub_CLU5076 iub_CLU5082 iub_CLU5099 iub_CLU5626 iub_CLU5627 iub_CLU5645 iub_CLU5678 iub_CLU5861
** iub_CLU5678 (OK) 11s 2f 1q 9r: iub_CLU1616 iub_CLU2494 iub_CLU5076 iub_CLU5082 iub_CLU5099 iub_CLU5626 iub_CLU5627 iub_CLU5645 iub_CLU5861
>>>>> iub_CLU1124 (5125) 12s 2f 0q 10r: iub_CLU1124 iub_CLU1616 iub_CLU2494 iub_CLU5076 iub_CLU5082 iub_CLU5099 iub_CLU5626 iub_CLU5627 iub_CLU5645 iub_CLU5861
** iub_CLU5082 (OK) 12s 3f 0q 9r: iub_CLU1124 iub_CLU1616 iub_CLU2494 iub_CLU5076 iub_CLU5099 iub_CLU5626 iub_CLU5627 iub_CLU5645 iub_CLU5861
** iub_CLU5627 (OK) 12s 4f 0q 8r: iub_CLU1124 iub_CLU1616 iub_CLU2494 iub_CLU5076 iub_CLU5099 iub_CLU5626 iub_CLU5645 iub_CLU5861
** iub_CLU5861 (OK) 12s 5f 0q 7r: iub_CLU1124 iub_CLU1616 iub_CLU2494 iub_CLU5076 iub_CLU5099 iub_CLU5626 iub_CLU5645
** iub_CLU5626 (OK) 12s 6f 0q 6r: iub_CLU1124 iub_CLU1616 iub_CLU2494 iub_CLU5076 iub_CLU5099 iub_CLU5645
** iub_CLU5099 (OK) 12s 7f 0q 5r: iub_CLU1124 iub_CLU1616 iub_CLU2494 iub_CLU5076 iub_CLU5645
** iub_CLU5645 (OK) 12s 8f 0q 4r: iub_CLU1124 iub_CLU1616 iub_CLU2494 iub_CLU5076
** iub_CLU2494 (OK) 12s 9f 0q 3r: iub_CLU1124 iub_CLU1616 iub_CLU5076
** iub_CLU5076 (OK) 12s 10f 0q 2r: iub_CLU1124 iub_CLU1616
** iub_CLU1616 (OK) 12s 11f 0q 1r: iub_CLU1124
** iub_CLU1124 (OK) 12s 12f 0q 0r:
##########################
iub_CLU5626 OK
iub_CLU5627 OK
iub_CLU2494 OK
iub_CLU5645 OK
iub_CLU5678 OK
iub_CLU5076 OK
iub_CLU5082 OK
iub_CLU5099 OK
iub_CLU5861 OK
iub_CLU5869 OK
iub_CLU1616 OK
iub_CLU1124 OK
Logfiles stored in /home/csdcnsnsg/tim/tx_w32
Pseudo-terminal will not be allocated because stdin is not a terminal.
/home/csdcnsnsg/.bashrc: line 49: ./rnc: Permission denied
-bash: line 2: ./txrun6667.txt: No such file or directory
[~]$
Need some help.
Business Accounts
Answer for Membership
by: glenthornePosted on 2009-08-12 at 08:54:04ID: 25079968
The output shows that the keys were saved as:
b
Your identification has been saved in /cygdrive/h/.ssh/id_rsa
Your public key has been saved in /cygdrive/h/.ssh/id_rsa.pu
Try running you ls command with the -a flag included (this shows "dot" file/dirs) - ls -ltrFa