{"id":12392,"date":"2019-03-26T22:20:57","date_gmt":"2019-03-26T22:20:57","guid":{"rendered":"http:\/\/www.appservgrid.com\/paw92\/?p=12392"},"modified":"2019-03-26T22:20:57","modified_gmt":"2019-03-26T22:20:57","slug":"how-to-use-conspy-to-view-and-control-remote-linux-virtual-consoles-in-real-time","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/26\/how-to-use-conspy-to-view-and-control-remote-linux-virtual-consoles-in-real-time\/","title":{"rendered":"How to Use Conspy to View and Control Remote Linux Virtual Consoles in Real Time"},"content":{"rendered":"<p>Computer networks have made it possible for end users to interact one with another in several ways. They have also provided a way to perform remote work without the hassle and the costs involved with traveling (or perhaps walking to a nearby office).<\/p>\n<p>Recently, I discovered a program called\u00a0<strong>conspy<\/strong>\u00a0in the\u00a0<strong>Debian<\/strong>\u00a0stable repositories and was glad to find out that it is available for\u00a0<strong>Fedora<\/strong>\u00a0and derivatives as well.<\/p>\n<div id=\"attachment_15686\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/09\/Conspy-Watch-Remote-Linux-Commands-in-Real-Time.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-15686\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/09\/Conspy-Watch-Remote-Linux-Commands-in-Real-Time.png\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/09\/Conspy-Watch-Remote-Linux-Commands-in-Real-Time.png 720w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/09\/Conspy-Watch-Remote-Linux-Commands-in-Real-Time-620x297.png 620w\" alt=\"Conspy Watch Remote Linux Commands in Real Time\" width=\"620\" height=\"297\" aria-describedby=\"caption-attachment-15686\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-15686\" class=\"wp-caption-text\">Conspy \u2013 Watch Remote Linux Commands in Real Time<\/p>\n<\/div>\n<p>It allows a user to see what is being displayed on a Linux virtual console, and also to send keystrokes to it in real time. In a certain way, you can think of\u00a0<strong>conspy<\/strong>\u00a0as similar to\u00a0<a href=\"https:\/\/www.tecmint.com\/installation-of-centos-remotely-using-vnc-mode\/\" target=\"_blank\" rel=\"noopener\">VNC<\/a>, with the difference that conspy operates in text mode (thus saving resources and making it possible to also support CLI-only servers) and in top of all that, does not require a server-side service to be installed prior to being used.<\/p>\n<p>That said, you only need to make sure that there is network connectivity to the remote computer and you will learn to love\u00a0<strong>conspy<\/strong>.<\/p>\n<h3>Installing conspy in Linux<\/h3>\n<p>In\u00a0<strong>Debian 8<\/strong>\u00a0and derivatives,\u00a0<strong>conspy<\/strong>\u00a0is available directly from the repositories, so installing it is as simple as:<\/p>\n<pre># aptitude update &amp;&amp; aptitude install conspy\r\n<\/pre>\n<p>Whereas in\u00a0<strong>CentOS 7<\/strong>\u00a0and other\u00a0<strong>Fedora-based<\/strong>\u00a0distros you first have to enable the\u00a0<strong>Repoforge<\/strong>\u00a0repository:<\/p>\n<p><strong>1.<\/strong>\u00a0Go to\u00a0<a href=\"http:\/\/pkgs.repoforge.org\/rpmforge-release\" target=\"_blank\" rel=\"nofollow noopener\">http:\/\/pkgs.repoforge.org\/rpmforge-release<\/a>\u00a0and search for the latest version of the repository (as of September 2015 the latest package is\u00a0<strong>rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm<\/strong>) and download it:<\/p>\n<pre># wget http:\/\/pkgs.repoforge.org\/rpmforge-release\/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm\r\n<\/pre>\n<p><strong>2.<\/strong>\u00a0Install the repository package:<\/p>\n<pre># rpm \u2013Uvh rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm\r\n<\/pre>\n<p><strong>3.<\/strong>\u00a0And then install the\u00a0<strong>conspy<\/strong>\u00a0package itself:<\/p>\n<pre># yum update &amp;&amp; yum install conspy\r\n<\/pre>\n<h3>Testing Environment Used for conspy<\/h3>\n<p>To see how\u00a0<strong>conspy<\/strong>\u00a0works, we will\u00a0<strong>ssh<\/strong>\u00a0into a\u00a0<strong>Debian 8<\/strong>\u00a0server [<strong>IP 192.168.0.25<\/strong>] (using Terminal or\u00a0<a href=\"https:\/\/www.tecmint.com\/gnome-commander-file-manager\/\" target=\"_blank\" rel=\"noopener\">gnome ter<\/a>, for example) where the ssh daemon is listening on port\u00a0<strong>11222<\/strong>:<\/p>\n<pre># ssh \u2013p 11222 user@192.168.0.25\r\n<\/pre>\n<p>Right next to our Terminal, we will place a\u00a0<strong>Virtualbox<\/strong>\u00a0window that will be used to display\u00a0<strong>ttys<\/strong>. Remember that you will need to press Right\u00a0<strong>Ctrl + F1<\/strong>\u00a0through\u00a0<strong>F6<\/strong>\u00a0to switch between ttys inside a Virtualbox window, and\u00a0<strong>Ctrl + Alt + F1<\/strong>\u00a0through\u00a0<strong>F6<\/strong>\u00a0to switch between consoles in a real (i.e. not virtualized) server.<\/p>\n<h3>Using conspy to Display and Control ttys<\/h3>\n<p>To launch\u00a0<strong>conspy<\/strong>, ssh into the remote server and then just type:<\/p>\n<pre># conspy\r\n<\/pre>\n<p>followed by a\u00a0<strong>tty<\/strong>\u00a0number, (1 through 6). You will notice that the background color of your Terminal changes. We will use the\u00a0<strong>tty<\/strong>\u00a0command to identify the file name of the terminal currently connected to standard input. If a tty is not supplied as argument, the currently active virtual console is opened and tracked.<\/p>\n<p>Note that after launching the program as:<\/p>\n<pre># conspy 1\r\n<\/pre>\n<p>The first terminal\u00a0<strong>(tty1)<\/strong>\u00a0is displayed instead of\u00a0<strong>pts\/0<\/strong>\u00a0(the initial\u00a0<strong>pseudo-terminal<\/strong>\u00a0for a ssh connection):<\/p>\n<div id=\"attachment_15677\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/09\/Conspy-Usage.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-15677\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/09\/Conspy-Usage.png\" alt=\"Conspy Usage\" width=\"568\" height=\"111\" aria-describedby=\"caption-attachment-15677\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-15677\" class=\"wp-caption-text\">Conspy Usage<\/p>\n<\/div>\n<p>To exit, press\u00a0<strong>Esc<\/strong>\u00a0three times in quick succession.<\/p>\n<h3>Watch Conspy in Action<\/h3>\n<p>To better see conspy in action, please take a minute to watch the following screencasts:<\/p>\n<p><strong>1.<\/strong>\u00a0Keystrokes being sent from the\u00a0<strong>client<\/strong>\u00a0to remote\u00a0<strong>tty<\/strong>:<\/p>\n<p><iframe loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/4QXFsfypY34\" width=\"780\" height=\"439\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p><strong>2.<\/strong>\u00a0Tty contents are displayed in the client as they appear in the remote tty:<\/p>\n<p><iframe loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/XD7e_aCPbBs\" width=\"780\" height=\"439\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p>In the above videos you can see a couple of interesting things:<\/p>\n<ol>\n<li>You can run commands or type text in a\u00a0<strong>pseudo-terminal<\/strong>\u00a0and they will be visualized in the remote console, and viceversa.&lt;.li&gt;<\/li>\n<li>There is no need to launch a server-side program in the server at the distant location, as opposed to other tech support software that requires someone to start a service for you to connect remotely to.<\/li>\n<\/ol>\n<ol>\n<li>Conspy also allows you to visualize in real time the output of programs such as\u00a0<strong>top<\/strong>\u00a0or\u00a0<strong>ping<\/strong>\u00a0which is refreshed or changed continuously with only a very slight delay. This includes\u00a0<strong>ncurses-based<\/strong>\u00a0programs such as\u00a0<a href=\"https:\/\/www.tecmint.com\/install-htop-linux-process-monitoring-for-rhel-centos-fedora\/\" target=\"_blank\" rel=\"noopener\">htop \u2013 Linux Process Monitoring<\/a>\u00a0as well:<\/li>\n<\/ol>\n<div id=\"attachment_15680\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/09\/Conspy-with-Htop-Linux-Process-Monitoring.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-15680\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/09\/Conspy-with-Htop-Linux-Process-Monitoring-620x106.png\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/09\/Conspy-with-Htop-Linux-Process-Monitoring-620x106.png 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/09\/Conspy-with-Htop-Linux-Process-Monitoring-1024x175.png 1024w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/09\/Conspy-with-Htop-Linux-Process-Monitoring.png 1357w\" alt=\"Conspy with Htop Linux Process Monitoring\" width=\"620\" height=\"106\" aria-describedby=\"caption-attachment-15680\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-15680\" class=\"wp-caption-text\">Conspy with Htop Linux Process Monitoring<\/p>\n<\/div>\n<p>If you only want to view a remote terminal instead of sending keystrokes or commands, just launch\u00a0<strong>conspy<\/strong>\u00a0with the\u00a0<strong>-v<\/strong>\u00a0switch (view only).<\/p>\n<h3>Using conspy with Putty<\/h3>\n<p>If you use a\u00a0<strong>Windows<\/strong>\u00a0laptop or desktop for work you can still take advantage of conspy. After logging on to the remote system with\u00a0<strong>Putty<\/strong>, the famous ssh client for Windows, you can still launch\u00a0<strong>conspy<\/strong>\u00a0as explained above, as shown in the following screencast:<\/p>\n<p><iframe loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/KuV4BSJMpdU\" width=\"780\" height=\"439\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p>Conspy Limitations<\/p>\n<p>Despite its nice features, conspy also has some limitations, which you should take into account:<\/p>\n<ol>\n<li>It only allows you to view, connect to, or control real terminals (ttys), not pseudo ones (pts\/Xs).<\/li>\n<li>It may display non-ASCII characters (\u00e1, \u00e9, \u00f1, to name a few examples) incorrectly or not at all:<\/li>\n<\/ol>\n<div id=\"attachment_15682\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/09\/Conspy-Limitations.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-15682\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/09\/Conspy-Limitations.png\" alt=\"Conspy: Non ASCII Characters\" width=\"251\" height=\"144\" aria-describedby=\"caption-attachment-15682\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-15682\" class=\"wp-caption-text\">Conspy: Non ASCII Characters<\/p>\n<\/div>\n<p>It requires super user permissions (either as\u00a0<strong>root<\/strong>\u00a0or through\u00a0<strong>sudo<\/strong>) to launch.<\/p>\n<h3>Summary<\/h3>\n<p>In this guide we have introduced you to\u00a0<strong>conspy<\/strong>, a priceless tool to control remote terminals that consumes very little in terms of system resources.<\/p>\n<p>I hope that you take the time to install and try out this great utility, and highly recommend you bookmark this article because in my humble opinion this is one of those tools that need to be a part of every system administrator\u2019s skills set.<\/p>\n<p><a href=\"https:\/\/www.tecmint.com\/use-conspy-to-view-and-control-remote-linux-virtual-consoles\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Computer networks have made it possible for end users to interact one with another in several ways. They have also provided a way to perform remote work without the hassle and the costs involved with traveling (or perhaps walking to a nearby office). Recently, I discovered a program called\u00a0conspy\u00a0in the\u00a0Debian\u00a0stable repositories and was glad to &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/26\/how-to-use-conspy-to-view-and-control-remote-linux-virtual-consoles-in-real-time\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to Use Conspy to View and Control Remote Linux Virtual Consoles in Real Time&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-12392","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12392","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=12392"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12392\/revisions"}],"predecessor-version":[{"id":12393,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12392\/revisions\/12393"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=12392"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=12392"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=12392"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}