Ubuntu Сообщение в Windows 7 не работает?

6515
Benjamin Jones

После многих поисков в Google я вижу, что можно отправить сообщение с компьютера с Ubuntu на компьютер с Windows XP с помощью следующего кода smbclient.

эхо "Привет, мир" | smbclient -M "WindowsHost". Отправляет сообщение и показывает Windows Meesage Popup

Однако я не нашел ни одного человека, работающего под управлением Windows 7 или 8, который мог бы отправить сообщение из Ubuntu или ЛЮБОГО ДРУГОГО дистрибутива. Я думаю, что он работает нормально, потому что новая утилита сообщений Windows - MSG, которая работает, если вы отправляете сообщение с компьютера Windows на компьютер Windows.

Так почему бы не

echo "hello world" | smbclient -M "WindowsHost" send a popup message to Window Computer? 

Альтернатива smbclient для отправки сообщения на компьютер с Windows 7 или 8?

3

1 ответ на вопрос

3
Rik

According to this:

Windows Vista, Windows 7, and Windows 8 have no Netsend command at all, and you need additional software to receive or send net messages, like our LanTalk NET.

So... no more smbclient to send a message to Windows Vista and higher.


According to this, Windows 7 does have the MSG.EXE-command but i haven't figured out if you can send a message from a Linux-based machine to Windows 7.

C:\>msg rik hello world
gives me the dialog below so the mechanism is still there.
Now we need to find a way to do it from Linux.

enter image description here

But it is certain that smbclient is not compatible with msg.exe.

You could try to Google for a Linux version


Edit:

I did some searching and couldn't find any Linux-programs which can communicate with the standard MSG.EXE-service of Windows. Due to the many exploits of the net send-command by hackers and spammers Microsoft retired the service (as of Vista) and the new MSG.EXE communications are encrypted.

Next idea is to execute the MSG.EXE-command remotely on a Windows machine. This should be doable with the PsExec-service.

First i tried to use PsExec from Windows XP to Windows 7 (just to be sure PsExec worked).
But i got an "access denied"-error. From here i followed the first suggestion and the registry change on the target Windows 7 worked:
(i also needed to do this on a clean Windows 8.1 machine i tested with as target)

reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1 /f 

(If "Windows (PsExec) -> Windows" doesn't work "Linux (winexe) -> Windows" certainly wouldn't work.)

Next i installed winexe on my ancient Fedora 3 server from 2004. (Yeah... i know ;).
I got a lot of warnings during compilation but non were fatal.

wget http://downloads.sourceforge.net/project/winexe/winexe-1.00.tar.gz tar xzvf winexe-1.00.tar.gz cd winexe-1.00/source4/ ./autogen.sh ./configure make bin/winexe -U user%password //xps8500 'cmd' Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\Windows\system32> 

I got the command-prompt from the remote system.

Next the command:

bin/winexe -U user%password //xps8500 'msg rik hello world' 

and i got the same image as above. So that works. It's not very pretty to use PsExec/winexe to execute MSG.EXE, but hey... it works ;)

(just test every system you need if they can be used as target for PsExec or can receive a MSG.EXE-message with /server:x from another Windows machine you PsExec to)

Personally i don't like a dialog popping up during my work (blocking everything i type), so i use a small less intrusive messaging system, which pops out a small window near the system tray (which disappears after a timeout) but that requires additional software. There are a lot of simple messaging programs you could use. You could also code your own. It doesn't have to be fancy to just show a popup in the right-bottom corner.

Привет Рик, я нашел этот путь: http://askubuntu.com/questions/335026/sending-commands-from-ubuntu-13-04-to-windows-7 Benjamin Jones 10 лет назад 0
Да, я как раз собирался добавить [эту ссылку] (http://micksmix.wordpress.com/2012/08/09/winexe-a-psexec-like-client-for-accessing-windows-from-linux/). Использование команды, подобной psexec, для запуска `msg.exe` на компьютере с Windows кажется долгим, но сработало бы;) Rik 10 лет назад 0
Я не настроил winexe YET, но это может сработать: winexe -U 'user% password' // IP 'msg * Перейти по ссылке "http://google.com"' Benjamin Jones 10 лет назад 0
Ваше право, это долгий путь, но что делать? К вашему сведению, все это должно работать для того, что я хочу сделать: каждый раз, когда пользователь получает IP-адрес, отправляет ему сообщение (в зависимости от ОС) с сервера Ubuntu. Спасибо за помощь! Я хотел сделать все на стороне конечного пользователя как «нативное» / им не нужно ничего скачивать, насколько это возможно. Еще раз спасибо! Benjamin Jones 10 лет назад 0
Ага. Это выглядит правильно. (Я тоже попробую завтра на моем Linux-сервере). Я также буду гуглить еще для более нативного (совместимого) решения. Rik 10 лет назад 1
Добавлен Edit с моим опытом работы с 'winexe` (альтернатива Linux для `PsExec`) Rik 10 лет назад 1
Хорошо, спасибо! Вы уже попробовали winexe? Benjamin Jones 10 лет назад 0
Да. Вы можете прочитать о моем опыте с `winexe` (компиляция и запуск) в моем редакторе (наполовину мой ответ :). `bin / winexe -U user% password // xps8500 'msg rik hello world'` работал прекрасно. Rik 10 лет назад 1
Я работал отлично. Единственный минус в том, что вам нужны имя пользователя и пароль. Таким образом, вы не можете свободно отправить сообщение, как вы могли бы с клиентом smb Benjamin Jones 10 лет назад 0
Да, и проблема в том, что пользователь также должен быть администратором, чтобы иметь возможность подключаться к `PsExec / winexe` :( Вы можете` chmod 700` файл и ограничить доступ только к себе (чтение, запись и выполнение), но все же , это угроза безопасности. Другой способ - создать файл в Ubuntu (или общедоступном общем ресурсе) и создать пакетный файл на компьютере с Windows (который будет выполняться каждую минуту или около того с планировщиком задач) для проверки этого файла. и `msg` выводит содержимое на другие Windows-машины (с помощью некоторых сценариев вы можете даже указать его назначение, так сказать, плохую службу обмена сообщениями;) Rik 10 лет назад 0
Правда. Спасибо за вашу помощь Benjamin Jones 10 лет назад 0