T
T
Timur Yakhin2016-04-22 15:52:19
linux
Timur Yakhin, 2016-04-22 15:52:19

How to write a telnet connection command from linux to window with login and password recoding?

I have a Windows 8 computer with a configured telnet server. From another computer on Windows 7 it is possible to connect to it using the login and password "Julia" / "Rjat2000" How to connect from linux (bash)? I can't connect directly - apparently the problem is in the encoding. How to correctly recode the login and password and feed them to telnet?

#!/bin/bash

login=`echo "Юлия" | iconv -а UTF-8 -t KOI8-R`
password="Rjat2000"
host="192.168.1.42"
comand="nir mutesysvolume 2"

(
sleep 1
echo $password
sleep 1
echo $comand
) | telnet -l $login $host

An example of a non-working attempt to connect and send a command

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Kuts, 2016-04-22
@fox_12

And why do you recode in KOI8-R ?
For Windows, either CP1251 or CP866

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question