LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-20-2021, 11:27 AM   #1
julio213180
LQ Newbie
 
Registered: Feb 2012
Posts: 1

Rep: Reputation: Disabled
help with ssh and monitor attached to server


Hi Guys, can you please give some advise on a little problem that I'm facing, and maybe some confusion to?
I have a file/web server that I use to play with it, and it does not have a graphical desk top, after it boots it stays on a terminal mode waiting for commands.
i use ssh (putty) to login on the server from my desktop PC.
What i wanted to ask, is it possible to have all the commands that I'm typing on the ssh appear on the monitor that is connect on the server?
I searched to web trying to find something about that, but was unsuccessful, can you please give me some ideas?
i found a option to forward a session by using the option -X on ssh, but to use that would i have to have the x server installed on my server?
and if I do install it, would it make the server have a graphical desktop? I don't want to have the server to be graphical, I like it in terminal mode.
thank you.
 
Old 12-20-2021, 12:04 PM   #2
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,310
Blog Entries: 3

Rep: Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722
Welcome back. Which distro is this for?

Quote:
Originally Posted by julio213180 View Post
What i wanted to ask, is it possible to have all the commands that I'm typing on the ssh appear on the monitor that is connect on the server?
Kind of, but for what reason? The commands you run via PuTTY have the same effects as if they were run locally via the console on the server itself.

One way to have both your PuTTY terminal and the server's console showing the same output would be to use a terminal multiplexer like tmux. Most servers have it available by default, but if not you can install it with your package manager. After that, start a new session on the server's console:

Code:
tmux new-session -s console
Then use PuTTY from the other machine and log in to the same account. From there, attach to the established session:

Code:
tmux attach-session -t  console
There are a lot of variations on that theme. There is a lot more which can be done with tmux, so it has a lot of options and the reference manual "man tmux" is quite long.

About X11, it is the other way around. The X server is the graphical display and the programs you see and interact with are the clients. So it would be possible to run a graphical program on your server and have it display on your local machine by means of X forwarding. If you have a legacy OS you might have to add a package like Xming or XQuartz to have the prerequisite X server for that.

Which activities do you wish to do on the server?
 
Old 12-20-2021, 12:32 PM   #3
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
For some ideas, check answers to the question How can I hook on to one terminal's output from another terminal? @SE U&L.
 
Old 12-20-2021, 01:30 PM   #4
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,310
Blog Entries: 3

Rep: Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722
Quote:
Originally Posted by shruggy View Post
For some ideas, check answers to the question How can I hook on to one terminal's output from another terminal? @SE U&L.
In that direction, once one knows the device of the terminal and the console, and one is using an advanced shell like Bash or Zsh, then tee can be used with process substitution and redirection to mirror from the PTS into both.

Code:
exec &> >(tee -a /dev/tty3)
There, SSH is logged into some PTS and the console is active on TTY3. It will mirror any output from the PTS to the TTY but not vice versa. Although one can work in the TTY and nothing will show up in the PTS. So the TTY is not read-only. Read-only could be arranged in tmux with a little planning.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Server will not boot when no monitor attached zeigleml Linux - Server 1 01-10-2014 02:12 AM
can vim have tabs attached to viewports instead of viewports attached to tabs? frznchckn Linux - Software 0 11-17-2010 08:15 PM
pl2303 attached to ttyUSB0 but driver attached to device is "serial" sheeluh Linux - Software 4 03-12-2007 04:27 AM
How can I say mouse is attached or not attached at the serial port ? lovelylinux Linux - Hardware 1 02-07-2007 09:44 AM
Serial Mouse is attached or not attached at seiral port lovelylinux Linux - Hardware 1 01-28-2007 07:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration