# Windows, Shell, SSH, stdin, and Xojo

**URL:** <https://forum.xojo.com/t/windows-shell-ssh-stdin-and-xojo/57708>\
**Category:** Windows\
**Created:** [October 7, 2020, 7:43pm UTC](https://forum.xojo.com/t/windows-shell-ssh-stdin-and-xojo/57708 "2020-10-07T19:43:20Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tim\_Parnell](https://forum.xojo.com/user_avatar/forum.xojo.com/tim_parnell/32/161_2.png) [@Tim\_Parnell](https://forum.xojo.com/u/Tim_Parnell)\
**Post date:** [October 7, 2020, 7:43pm UTC](https://forum.xojo.com/t/windows-shell-ssh-stdin-and-xojo/57708/1 "2020-10-07T19:43:20Z")

</div>

When trying to use ssh with an interactive Shell on Windows, I get “Pseudo-terminal will not be allocated because stdin is not a terminal.”

Google says I can correct this by passing `-tt` to disable Psuedo-terminal, but then nothing gets fed back to Xojo.

Has anyone gotten Shell to work with Xojo and SSH on Windows?

---

<div class="post-metadata">

**Author:** ![Christian\_Schmitz](https://forum.xojo.com/user_avatar/forum.xojo.com/christian_schmitz/32/158_2.png) [@Christian\_Schmitz](https://forum.xojo.com/u/Christian_Schmitz)\
**Post date:** [October 7, 2020, 8:11pm UTC](https://forum.xojo.com/t/windows-shell-ssh-stdin-and-xojo/57708/2 "2020-10-07T20:11:43Z")

</div>

You know we have [SSH2ChannelMBS](https://www.monkeybreadsoftware.net/class-ssh2channelmbs.shtml) class in [MBS Xojo Network Plugin](https://www.monkeybreadsoftware.de/xojo/plugin-network.shtml) to do SSH cross platform?

As well as [ShellMBS](https://www.monkeybreadsoftware.net/class-shellmbs.shtml) class if the Xojo built-in shell is not enough.

---

<div class="post-metadata">

**Author:** ![Kem\_Tekinay](https://forum.xojo.com/user_avatar/forum.xojo.com/kem_tekinay/32/154_2.png) [@Kem\_Tekinay](https://forum.xojo.com/u/Kem_Tekinay)\
**Post date:** [October 7, 2020, 8:15pm UTC](https://forum.xojo.com/t/windows-shell-ssh-stdin-and-xojo/57708/3 "2020-10-07T20:15:44Z")

</div>

I don’t have much to offer here, but what command are you passing to the Shell initially?

---

<div class="post-metadata">

**Author:** ![Tim\_Parnell](https://forum.xojo.com/user_avatar/forum.xojo.com/tim_parnell/32/161_2.png) [@Tim\_Parnell](https://forum.xojo.com/u/Tim_Parnell)\
**Post date:** [October 7, 2020, 8:22pm UTC](https://forum.xojo.com/t/windows-shell-ssh-stdin-and-xojo/57708/4 "2020-10-07T20:22:28Z")

</div>

None. I believe `ssh` is upset because technically this could be a security issue, it can tell there’s no real user-terminal. I’m just trying to put a user interface to an insane amount of command line work.

I’m really tired of rewriting this project, so if anyone has a project that connects to a server via ssh and handles all the boring stuff so I can work with the commands, I could really use that jumping point.

---

<div class="post-metadata">

**Author:** ![Christian\_Schmitz](https://forum.xojo.com/user_avatar/forum.xojo.com/christian_schmitz/32/158_2.png) [@Christian\_Schmitz](https://forum.xojo.com/u/Christian_Schmitz)\
**Post date:** [October 7, 2020, 8:24pm UTC](https://forum.xojo.com/t/windows-shell-ssh-stdin-and-xojo/57708/5 "2020-10-07T20:24:41Z")

</div>

Now you may know why I wrote all the SSH classes. Because we couldn’t do the password thing otherwise!

---

<div class="post-metadata">

**Author:** ![Tim\_Parnell](https://forum.xojo.com/user_avatar/forum.xojo.com/tim_parnell/32/161_2.png) [@Tim\_Parnell](https://forum.xojo.com/u/Tim_Parnell)\
**Post date:** [October 7, 2020, 8:25pm UTC](https://forum.xojo.com/t/windows-shell-ssh-stdin-and-xojo/57708/6 "2020-10-07T20:25:52Z")

</div>

I wish your classes would do more. There’s no DataAvailable event, and I’d have to re-implement a lot to authenticate with your methods. Your code makes it hard to follow the authentication procedure. I’m not super excited to rewrite this thing _yet again_.

It’d be great if one of your examples was a complete ssh terminal.

---

<div class="post-metadata">

**Author:** ![Thorsten\_Stueker](https://forum.xojo.com/user_avatar/forum.xojo.com/thorsten_stueker/32/1165_2.png) [@Thorsten\_Stueker](https://forum.xojo.com/u/Thorsten_Stueker)\
**Post date:** [October 7, 2020, 8:33pm UTC](https://forum.xojo.com/t/windows-shell-ssh-stdin-and-xojo/57708/7 "2020-10-07T20:33:14Z")

</div>

Tried one of my solutions running under Linux without problems but not under windows, ssh is not gworkkng think because thinks it is a sec issue. Tried to get it with Lazarus, works so I guess it needs a plug-in.

---

<div class="post-metadata">

**Author:** ![Andrew\_Paul\_Dickey](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/82dd89/32.png) [@Andrew\_Paul\_Dickey](https://forum.xojo.com/u/Andrew_Paul_Dickey)\
**Post date:** [October 7, 2020, 8:36pm UTC](https://forum.xojo.com/t/windows-shell-ssh-stdin-and-xojo/57708/8 "2020-10-07T20:36:23Z")

</div>

Hello Tim,

> **Getting started resources for SSH on windows**
>
> Getting started resources for SSH on windows:
> 
> [https://docs.microsoft.com/en-us/windows-server/administration/openssh/openssh\_install\_firstuse](https://docs.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse)
> 
> [https://www.howtogeek.com/336775/how-to-enable-and-use-windows-10s-built-in-ssh-commands/](https://www.howtogeek.com/336775/how-to-enable-and-use-windows-10s-built-in-ssh-commands/)

Tim, you can target cmd, Powershell or optionally install Bash on windows.

I always use Powershell because it is cross platform (Windows, Mac, Linux). For example I have Xojo web apps that build and manipulate Excel files from Xojo (without Excel installed) on our Linux web servers using Powershell.

Using Powershell also gives you access to thousands of open source libraries replacing a subset of functionality you otherwise require plugins for.

I expect your issue is in the ssh setup and not an issue with Xojo. Have you accepted the security key when during first use? I was stuck on that at one point.

I am also not convinced -tt is valid for ssh on windows, (I may be wrong but I have never used it).

Are your commands working directly in cmd or Powershell?

---

<div class="post-metadata">

**Author:** ![Tim\_Parnell](https://forum.xojo.com/user_avatar/forum.xojo.com/tim_parnell/32/161_2.png) [@Tim\_Parnell](https://forum.xojo.com/u/Tim_Parnell)\
**Post date:** [October 7, 2020, 8:43pm UTC](https://forum.xojo.com/t/windows-shell-ssh-stdin-and-xojo/57708/9 "2020-10-07T20:43:35Z")

</div>

> [@Andrew\_Paul\_Dickey](#):
>
> Are your commands working directly in cmd or Powershell?

The error message I received is `ssh` operating. The problem is that I can’t use `ssh` specifically with Xojo’s Shell object. Attempting not to establish a pseudo-terminal makes it so Xojo receives no data / `DataAvailable` event. Not passing the parameter nets me the error.

Yes. `ssh` works in cmd.exe.

---

<div class="post-metadata">

**Author:** ![Thorsten\_Stueker](https://forum.xojo.com/user_avatar/forum.xojo.com/thorsten_stueker/32/1165_2.png) [@Thorsten\_Stueker](https://forum.xojo.com/u/Thorsten_Stueker)\
**Post date:** [October 7, 2020, 8:49pm UTC](https://forum.xojo.com/t/windows-shell-ssh-stdin-and-xojo/57708/10 "2020-10-07T20:49:00Z")

</div>

Because xojo can not handle it. With the plug-in from Christian it works imediately

---

<div class="post-metadata">

**Author:** ![Andrew\_Paul\_Dickey](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/82dd89/32.png) [@Andrew\_Paul\_Dickey](https://forum.xojo.com/u/Andrew_Paul_Dickey)\
**Post date:** [October 7, 2020, 8:51pm UTC](https://forum.xojo.com/t/windows-shell-ssh-stdin-and-xojo/57708/11 "2020-10-07T20:51:05Z")

</div>

Noted Tim,

As a troubleshooting step, have you perhaps executed your scripts without using ssh (just direct to cmd or PS from Xojo)?

---

<div class="post-metadata">

**Author:** ![Tim\_Parnell](https://forum.xojo.com/user_avatar/forum.xojo.com/tim_parnell/32/161_2.png) [@Tim\_Parnell](https://forum.xojo.com/u/Tim_Parnell)\
**Post date:** [October 7, 2020, 8:55pm UTC](https://forum.xojo.com/t/windows-shell-ssh-stdin-and-xojo/57708/12 "2020-10-07T20:55:24Z")

</div>

Can someone from the Xojo team comment?  
@William_Yu @Paul_Lefebvre @Greg_O_Lone

Has anyone at Xojo ever been able to use Xojo, Shell, and SSH on Windows?

---

<div class="post-metadata">

**Author:** ![John\_Hansen](https://forum.xojo.com/letter_avatar_proxy/v4/letter/j/b4bc9f/32.png) [@John\_Hansen](https://forum.xojo.com/u/John_Hansen)\
**Post date:** [October 7, 2020, 9:05pm UTC](https://forum.xojo.com/t/windows-shell-ssh-stdin-and-xojo/57708/13 "2020-10-07T21:05:00Z")

</div>

Have you tried to use “plink” from putty [https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html](https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html)

---

<div class="post-metadata">

**Author:** ![Tim\_Parnell](https://forum.xojo.com/user_avatar/forum.xojo.com/tim_parnell/32/161_2.png) [@Tim\_Parnell](https://forum.xojo.com/u/Tim_Parnell)\
**Post date:** [October 7, 2020, 9:06pm UTC](https://forum.xojo.com/t/windows-shell-ssh-stdin-and-xojo/57708/14 "2020-10-07T21:06:08Z")

</div>

I’m trying to connect to a server via ssh and execute remote commands from within a Xojo app. I don’t understand how this would help?

---

<div class="post-metadata">

**Author:** ![John\_Hansen](https://forum.xojo.com/letter_avatar_proxy/v4/letter/j/b4bc9f/32.png) [@John\_Hansen](https://forum.xojo.com/u/John_Hansen)\
**Post date:** [October 7, 2020, 9:09pm UTC](https://forum.xojo.com/t/windows-shell-ssh-stdin-and-xojo/57708/15 "2020-10-07T21:09:04Z")

</div>

Hmm… Maybe I misunderstood your question.

---

<div class="post-metadata">

**Author:** ![Tim\_Parnell](https://forum.xojo.com/user_avatar/forum.xojo.com/tim_parnell/32/161_2.png) [@Tim\_Parnell](https://forum.xojo.com/u/Tim_Parnell)\
**Post date:** [October 7, 2020, 9:09pm UTC](https://forum.xojo.com/t/windows-shell-ssh-stdin-and-xojo/57708/16 "2020-10-07T21:09:45Z")

</div>

That’s ok, thanks for trying to help. I wanted to make sure I didn’t miss something.

---

<div class="post-metadata">

**Author:** ![John\_Hansen](https://forum.xojo.com/letter_avatar_proxy/v4/letter/j/b4bc9f/32.png) [@John\_Hansen](https://forum.xojo.com/u/John_Hansen)\
**Post date:** [October 7, 2020, 9:14pm UTC](https://forum.xojo.com/t/windows-shell-ssh-stdin-and-xojo/57708/17 "2020-10-07T21:14:08Z")

</div>

I’m not sitting at my office computer now. But In the past I have made many applications using the SSH opensource putty. The plink for remote SSH applications. Tomorrow I can have a look and forward you some code. This was done with an older version of Xojo

---

<div class="post-metadata">

**Author:** ![Tim\_Parnell](https://forum.xojo.com/user_avatar/forum.xojo.com/tim_parnell/32/161_2.png) [@Tim\_Parnell](https://forum.xojo.com/u/Tim_Parnell)\
**Post date:** [October 7, 2020, 9:16pm UTC](https://forum.xojo.com/t/windows-shell-ssh-stdin-and-xojo/57708/18 "2020-10-07T21:16:07Z")

</div>

> [@John\_Hansen](#):
>
> But In the past I have made many application using the SSH opensource putty. The plink for remote SSH applications

Do you mean that you include putty utilities with your Xojo app and operate ssh through those?

---

<div class="post-metadata">

**Author:** ![John\_Hansen](https://forum.xojo.com/letter_avatar_proxy/v4/letter/j/b4bc9f/32.png) [@John\_Hansen](https://forum.xojo.com/u/John_Hansen)\
**Post date:** [October 7, 2020, 9:16pm UTC](https://forum.xojo.com/t/windows-shell-ssh-stdin-and-xojo/57708/19 "2020-10-07T21:16:24Z")

</div>

yes

---

<div class="post-metadata">

**Author:** ![Andrew\_Paul\_Dickey](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/82dd89/32.png) [@Andrew\_Paul\_Dickey](https://forum.xojo.com/u/Andrew_Paul_Dickey)\
**Post date:** [October 7, 2020, 9:17pm UTC](https://forum.xojo.com/t/windows-shell-ssh-stdin-and-xojo/57708/20 "2020-10-07T21:17:09Z")

</div>

> **[Using the command-line connection tool Plink](https://the.earth.li/~sgtatham/putty/0.70/htmldoc/Chapter7.html#plink)**

[Next page](https://forum.xojo.com/t/windows-shell-ssh-stdin-and-xojo/57708.md?page=2)
