Cant get responsive terminal when I ssh from Windows to Linux using putty.exe


 
Thread Tools Search this Thread
Special Forums Windows & DOS: Issues & Discussions Cant get responsive terminal when I ssh from Windows to Linux using putty.exe
# 8  
Old 12-22-2019
@Rudic I tried using the -b option of sftp but it is still failing.

I changed by ssh_commands.txt as below:

Code:
cd /app/sftp;    <--- success
touch insidesftp.txt;   <--- success
echo "cd Moht;" >execmd.txt  <--- success
echo "get *;" >>execmd.txt  <--- success
echo "quit;" >>execmd.txt   <--- success
sshpass -p mypass -b execmd.txt sftp myuser@10.9.88.195;   <--- Fails (Although the command executes on remote Linux host I get an error in output)
touch sftpcompleted.txt    <--- success

Below is the error received:
Code:
EFT Server Enterprise 7.3.2.8Permission denied (password,keyboard-interactive).
Couldn't read packet: Connection reset by peer

However, when i fire the command manualy one by one this works fine. See output of Manual steps.

Code:
sshpass -p mypass sftp myuser@10.9.88.195
EFT Server Enterprise 7.3.2.8Connected to 10.9.88.195.
sftp> cd Moht
sftp> get *
Fetching /Moht/Jenkins_v1.0.docx to Jenkins_v1.0.docx
sftp> quit
[me_user@myremotelinuxhost sftp]$

Also the terminal closes instead of getting me the shell prompt.
# 9  
Old 12-22-2019
Quote:
Originally Posted by mohtashims
@Rudic I tried using the -b option of sftp but it is still failing.
Same point? Same error?

Quote:
.
.
.
Below is the error received:
Code:
EFT Server Enterprise 7.3.2.8 Permission denied (password,keyboard-interactive).
  Couldn't read packet: Connection reset by peer

Sounds like a "permission denied" error (to me). Are you sure about the users including their respective permissions and the applications / programs / commands (putty, ssh, sftp) on ALL THREE sides (windowsuser@windowssystem, myuser@10.8.66.126, myuser@10.9.88.195) of your experiment? Where do the scripts reside?

Quote:
However, when i fire the command manualy one by one this works fine. See output of Manual steps.
How about trying
Code:
sshpass -p mypass -b execmd.txt sftp myuser@10.9.88.195

in manual steps?
Quote:
Also the terminal closes instead of getting me the shell prompt.
That's why you need to run / exec your shell after having closed the sftp connection.
# 10  
Old 12-22-2019
@Rudic

Code:
$ cat getcmd.txt 
cd Moht
get *
quit

We have come to a point that this has nothing to do with windows as all issues have been addressed with your help / inputs.

The current issue i wish to deal with is when i fire the below command manually on target Linux host i get the below error:
Code:
sshpass  -p mypass sftp -b getcmd.txt myuser@10.9.88.195
EFT Server Enterprise 7.3.2.8Permission denied (password,keyboard-interactive).
Couldn't read packet: Connection reset by peer

However; removing the -b parameter resolves the issue in a way that I'm able to login to sftp and then i can fire the commands in getcmd.txt one by one manually successfully on sftp prompt like below.

Code:
$ sshpass  -p mypass sftp myuser@10.9.88.195
EFT Server Enterprise 7.3.2.8Connected to 10.9.88.195.
sftp> cd Moht
sftp> get *
Fetching /Moht/Jenkins_v1.0.docx to Jenkins_v1.0.docx
sftp> quit
[ sftp]$

For some reason it is not liking the -b option. I have made sure that getcmd.txt file has 775 file permission.

Can you please suggest ?

Last edited by mohtashims; 12-22-2019 at 10:41 PM..
# 11  
Old 12-23-2019
sftp's -b option doesn't seem to cooperate well with sshpass, which in itself is a security risk. Comments on the net: Never Use on Production Server, Users of sshpass are encouraged to use one of the other password passing techniques, which are all more secure.

man sshpass:
Quote:
Sshpass runs ssh in a dedicated tty, fooling it into ...
- doesn't sound too secure, does it?

Quote:
-b batchfile
Batch mode reads a series of commands from an input batchfile instead of stdin. Since it lacks user interaction it should be used in conjunction with non-interactive authentication
So - all that boils down to: Consider non-interactive, passwordless authentication.


Quote:
Originally Posted by mohtashims
@Rudic
..
.
Can you please suggest ?
Did you read my other comments?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Seen Windows pc, having all the features of Linux, could exe, read and edit save like windows

Hi, totally new to linux base using windows when started learning and using computers. but i remember that one pc was there , look alike windows desktop, but could not do the task as windows just click and open and view edit etc. But, you could do a little differently even saving in and opening... (8 Replies)
Discussion started by: jraju
8 Replies

2. Solaris

How to run putty.exe file in server?

Hi, I want to run putty.exe in Solaris server.My main aim is to invoke the putty.exe in Solaris server from a web application(.jsp) deployed in the server so that putty terminal should open. Thanks in advance (11 Replies)
Discussion started by: chaithanyaa
11 Replies

3. Shell Programming and Scripting

Windows exe file fails when triggered from ssh

Hi, I am triggering a windows exe file using the below command. ssh user@remoteserver command.exe -option1:xx /option2:yy This command is working fine from windows command prompt. When I am triggering the same command from ssh I get the error message cant load Any ideas to deal with... (2 Replies)
Discussion started by: ahmedwaseem2000
2 Replies

4. UNIX for Dummies Questions & Answers

[Solved] Is it possible to use PuTTY psftp.exe to move file from one directory to another?

Hello All, I am running a script (power shell) from my desktop (Windows). The script needs to sftp a file(using PuTTY psftp.exe ) from my desktop to a server(UNIX server). Then, as a second step, the script needs to move (or copy and delete) this file from one directory on the server (UNIX server)... (3 Replies)
Discussion started by: scampi
3 Replies

5. Linux

Help!! trying to connect to linux SSH from windows putty client

Hi, i am trying to connect my Putty session on a windows box to a linux SSH, i have generated private and public key pairs using puttygen, i have set the public one to be in an OPENSSH format... and have put this in my authorized_keys file in linux, when i connect i get the following errors: ... (1 Reply)
Discussion started by: Jtyreman
1 Replies

6. UNIX for Dummies Questions & Answers

startX windows application during boot.....putty connection takes the windows

Dear all i am new to linux/debian i run my application on the computer...during startup in bashrc i wrk wid dis script to invoke startx..i do this above command and it works perfectly... if && ; then startx -- -br 1>/dev/null exit 0 fi i use winscp for file transfer and putty for... (1 Reply)
Discussion started by: venkat_330
1 Replies

7. UNIX for Dummies Questions & Answers

vnc over an ssh tunnel Linux to Linux to Windows

I *think* what I want to do is not only possible but easy, but as a "dummy" :) I can't figure it out. Here's what I have: Linux (Ubuntu 10.04) laptop that is not in my house, but has an Internet connection. Linux (Ubuntu 9.04) computer in my house that has unfettered access to the... (6 Replies)
Discussion started by: WesleyC
6 Replies

8. Windows & DOS: Issues & Discussions

looking for linux like tab terminal for windows

Hello all is there any free tool like linux tabbed terminal but for windows im used to work with putty and its great but i wander if there something like putty but with tabs thanks (12 Replies)
Discussion started by: umen
12 Replies

9. Red Hat

How to take printout of linux file from windows xp using putty?

Friends, I have installed Putty in my windows xp pc. I am connecting the RHEL AS 3 server using putty from my windows xp. My printer is connected to my windows xp. Now, i want to print text.txt of RHEL AS 3.0 in my windows xp printer through putty. For Example: my pc ip is 117.23.2.55... (3 Replies)
Discussion started by: sathyguy
3 Replies

10. UNIX for Dummies Questions & Answers

mac 10.4>terminal>linux remote server>ssh login accepted>session closed-why?

mac 10.4>terminal>linux remote server>ssh login accepted>session closed-why? AHHHH!! I have been connecting to the server with the line: ssh userid@website.com The remote server accepts my password; logs me in with ssh; posts a lovely welcome message AND closes the session. Is this a "term... (0 Replies)
Discussion started by: xprankard
0 Replies
Login or Register to Ask a Question