0

I have tried wall, but it does not show the message to local terminal. Can I show it to local terminal, too? The remote SSH and the local GUI terminal are the same user account.

The reason why I am trying to do is that I want to use it basically for "copy and paste" between host and guest (VM), when the hypervisor's "copy and paste" feature is not working. I could save the text to a text file and then reload it on the guest, but just displaying the text like wall would be easier.

1
  • The commands wall and write rely on the utmp records. Not every terminal emulator updates these records, in some it's a config option, while some others don't support updating these records at all (you might launch an external helper utility to maintain these records). Commented Oct 29, 2022 at 22:30

1 Answer 1

0

wall is a message broadcast facility for the local machine on which it's run. There is no capability for sending messages to remote systems. (See man wall for further information.)

If you're logged in from to a remote system with something like ssh, and wall is run on that remote system, the message will be displayed on all logged-in terminals. This will include the one hosting your ssh session.

Note that unless you a superuser, you can only write to terminals owned by other users where the user has not used mesg n (a default in a number of distributions' .profile files). The superuser can write everywhere regardless, and a user can always write to terminals logged in with their own user account.

If you're trying to send messages between two of your own terminals you might find write a little more focussed (see man write):

write roaima .... [Ctrl/D] 

Or, for specific direction to the user roaima logged on to terminal /dev/pts/0:

write roaima pts/0 .... [Ctrl/D] 

Some systems also include talk, xtalk, ytalk, phone, or one of a similar slew of applications. If these are installed on directly reachable systems it is possible to connect sessions across the network. (Note that I haven't tried these in well over ten years so they may be seriously obsolete.)

3
  • By "GUI terminal" I meant the default terminal app running in the guest OS's desktop. Wall, write, and other things I have tried only works in GUI terminal --> SSH but not in the other direction. For example, it seems that the SSH window running on the host is pts/0. In the GUI terminal, if I do write myid pts/1, the SSH window says broadcast from pts/0, and message can be sent. But if I do `write myid pts/0' in the SSH window, it says that the account is not logged in on pts/0. Commented Oct 28, 2022 at 13:52
  • You probably aren't logged on to pts/0. You can find out what tty you're on with the tty command Commented Oct 28, 2022 at 14:01
  • See my comment to the main post about utmp records. That's why write might fail with an error message for you. If you want to send a message to one of your own terminals, you might just do echo message > /dev/pts/0 or alike. Commented Oct 29, 2022 at 22:31

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.