this is for sending linux terminal messages to logged on members using two commands
Page 1 of 1
this is for sending linux terminal messages to logged on members using two commands
1st
you will need notify installed on both machines and also ssh server access on the recipient side, if you have ssh access you can install notify remotely which is good!
if you need open ssh-srver
community.linuxmint.com/software/view/openssh-server
man.openbsd.org/ssh_config
Enable port 22 in you're firewall!
- Code:
sudo apt install -y notify-osd libnotify-bin
Code:
- Code:
#!/bin/bash
# (c) J~Net 2017
#
# chmod +x *.sh
#
# Non Kali Install
# sudo apt install -y notify-osd libnotify-bin
#
apt install -y notify-osd libnotify-bin
clear
echo "Hi & Welcome To J~Net Messenger (c) 2017 ~ To Quit ctrl z"
echo "Input Remote Username (ssh)"
read user
echo "Input IP Or Hostname"
read ip
echo "Input You're Name"
read from
echo "Input Message"
read msg
echo "Message Sent, App Will Now Exit, Thanks For Using J~Net Messenger."
ssh $user@$ip 'export DISPLAY=:0; notify-send "From '$from'" "'$msg'"'
# on remote pc u may need to install
# sudo apt install -y notify-osd libnotify-bin
Script sent from Kali Linux 2.0 2017.1 to Linux Mint 18 (Both 64 bit)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Other Methods:
linux.byexamples.com/archives/233/write-a-message-to-login-users-through-terminal/
inside terminal type
- Code:
who
and this will display all logged on users
and now type
- Code:
wall
this will send message to members example
wall
press enter
type messgae
press enter
ctrl d when finished
Last edited by jamied_uk on 6th May 2017, 17:16; edited 3 times in total
Re: this is for sending linux terminal messages to logged on members using two commands
More info @
computerhope.com/unix/wall.htm
computerhope.com/unix/wall.htm
Re: this is for sending linux terminal messages to logged on members using two commands
- Code:
wall [-n] [-t TIMEOUT] [file]
- Code:
sudo wall message.txt
Re: this is for sending linux terminal messages to logged on members using two commands
Also you can use talk
- Code:
talk user@hostname
Re: this is for sending linux terminal messages to logged on members using two commands
More on talk and examples
More info @
computerhope.com/unix/talk.htm
talk syntax
- Code:
talk person [ttyname]
Options
person | If you want to talk to someone on your machine, then person is just the person's login name. If you want to talk to a user on another host, then person is of the form 'user@host'. |
ttyname | If you want to talk to a user who is logged in more than once, the ttyname argument may be used to indicate the appropriate terminal name, where ttyname is of the form 'ttyXX' or 'pts/X'. |
talk examples
- Code:
talk hope
More info @
computerhope.com/unix/talk.htm
Re: this is for sending linux terminal messages to logged on members using two commands
Now lets look at Write
Write a message to the user hope. After entering this command, you will be placed on a blank line, where everything you type will be sent to the other user (line by line). Typing the interrupt character (Ctrl-C, by default) will return you to the command prompt and end the write session.
More info @
computerhope.com/unix/write.htm
write examples
- Code:
write hope
Write a message to the user hope. After entering this command, you will be placed on a blank line, where everything you type will be sent to the other user (line by line). Typing the interrupt character (Ctrl-C, by default) will return you to the command prompt and end the write session.
- Code:
write hope tty7
user | The user to write to. |
tty | The specific terminal to write to, if the user is logged in to more than one session. |
More info @
computerhope.com/unix/write.htm
Re: this is for sending linux terminal messages to logged on members using two commands
Now for Notify
send message to screen of another system:
and then when you're logged in, type:
Some examples:
1. Basic message with an icon in front of the Title showing 5000 milliseconds
Code:
2. Show contents of a file:
Code:
3. Follow log file:
Code:
4. Format message with HTML:
Code:
- Code:
sudo apt install -y notify-osd libnotify-bin
notify-send Test "Hello World"
send message to screen of another system:
- Code:
ssh <user name>@<ip address>
and then when you're logged in, type:
- Code:
export DISPLAY=:0
- Code:
notify-send "Title of message" "message text"
- Code:
notify-send --help
Some examples:
1. Basic message with an icon in front of the Title showing 5000 milliseconds
Code:
- Code:
notify-send "Message Title" "The message body is shown here" -i /usr/share/pixmaps/idle.xpm -t 5000
2. Show contents of a file:
Code:
- Code:
notify-send test "`tail /var/log/syslog`"
3. Follow log file:
Code:
- Code:
tail -n0 -f /var/log/messages | while read line; do notify-send "System Message" "$line"; done
4. Format message with HTML:
Code:
- Code:
notify-send Test "<font size=16 color=blue><b><i>Hello World</b></i></font>"
Last edited by jamied_uk on 6th May 2017, 15:50; edited 1 time in total
Re: this is for sending linux terminal messages to logged on members using two commands
Using Netcat (aka nc)
On PC 1, type:
On PC 1, type:
- Code:
nc -l 55555
- Code:
nc $IP 55555
- Code:
$IP
- Code:
192.168.2.50
Re: this is for sending linux terminal messages to logged on members using two commands
Ytalk
- Code:
apt install -y ytalk
- Code:
ytalk [-x] [-s] [-Y] [-i] [-h hostname_or_ip] username...
Similar topics
» Sending messages through pts tty on linux
» Show os Info like logged in linux username and home folder
» linux terminal keyboard shortcuts
» update linux password with terminal
» Find file or dir on linux with terminal
» Show os Info like logged in linux username and home folder
» linux terminal keyboard shortcuts
» update linux password with terminal
» Find file or dir on linux with terminal
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum