<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="mn">
		<id>https://wiki.dusal.net/index.php?action=history&amp;feed=atom&amp;title=Reptyr_%D0%B0%D1%88%D0%B8%D0%B3%D0%BB%D0%B0%D0%BD_SSH_session_%D0%B1%D1%83%D1%86%D0%B0%D0%B0%D0%BD_%D0%B0%D1%88%D0%B8%D0%B3%D0%BB%D0%B0%D1%85</id>
		<title>Reptyr ашиглан SSH session буцаан ашиглах - Түүх</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.dusal.net/index.php?action=history&amp;feed=atom&amp;title=Reptyr_%D0%B0%D1%88%D0%B8%D0%B3%D0%BB%D0%B0%D0%BD_SSH_session_%D0%B1%D1%83%D1%86%D0%B0%D0%B0%D0%BD_%D0%B0%D1%88%D0%B8%D0%B3%D0%BB%D0%B0%D1%85"/>
		<link rel="alternate" type="text/html" href="https://wiki.dusal.net/index.php?title=Reptyr_%D0%B0%D1%88%D0%B8%D0%B3%D0%BB%D0%B0%D0%BD_SSH_session_%D0%B1%D1%83%D1%86%D0%B0%D0%B0%D0%BD_%D0%B0%D1%88%D0%B8%D0%B3%D0%BB%D0%B0%D1%85&amp;action=history"/>
		<updated>2026-05-04T12:24:04Z</updated>
		<subtitle>Вики дэх энэ хуудасны засварын түүх</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>https://wiki.dusal.net/index.php?title=Reptyr_%D0%B0%D1%88%D0%B8%D0%B3%D0%BB%D0%B0%D0%BD_SSH_session_%D0%B1%D1%83%D1%86%D0%B0%D0%B0%D0%BD_%D0%B0%D1%88%D0%B8%D0%B3%D0%BB%D0%B0%D1%85&amp;diff=519&amp;oldid=prev</id>
		<title>Almas: Хуудас үүсгэв: &quot;  Use reptyr to reparent a running program to a new terminal. HOW TO:  Lets assume that we have connected to ssh from some previous IP address aaa.bbb.ccc.old, then r...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.dusal.net/index.php?title=Reptyr_%D0%B0%D1%88%D0%B8%D0%B3%D0%BB%D0%B0%D0%BD_SSH_session_%D0%B1%D1%83%D1%86%D0%B0%D0%B0%D0%BD_%D0%B0%D1%88%D0%B8%D0%B3%D0%BB%D0%B0%D1%85&amp;diff=519&amp;oldid=prev"/>
				<updated>2022-10-09T09:08:51Z</updated>
		
		<summary type="html">&lt;p&gt;Хуудас үүсгэв: &amp;quot;  Use reptyr to reparent a running program to a new terminal. HOW TO:  Lets assume that we have connected to ssh from some previous IP address aaa.bbb.ccc.old, then r...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Шинэ хуудас&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
Use reptyr to reparent a running program to a new terminal.&lt;br /&gt;
HOW TO:&lt;br /&gt;
&lt;br /&gt;
Lets assume that we have connected to ssh from some previous IP address aaa.bbb.ccc.old,&lt;br /&gt;
then run aptitude process, and in the middle of the work that connection got broken.&lt;br /&gt;
&lt;br /&gt;
We login with ssh again (optionally from a different IP address aaa.bbb.ccc.new).&lt;br /&gt;
The current connection uses pty/1 pseudo-terminal:&lt;br /&gt;
&lt;br /&gt;
$ tty&lt;br /&gt;
/dev/pts/1&lt;br /&gt;
&lt;br /&gt;
But there are 2 open connections, the current pts/1 one, and the old broken one using pts/0:&lt;br /&gt;
&lt;br /&gt;
$ who&lt;br /&gt;
user     pts/0        2022-02-22 22:00 (aaa.bbb.ccc.old)&lt;br /&gt;
user     pts/1        2022-02-22 22:11 (aaa.bbb.ccc.new)&lt;br /&gt;
&lt;br /&gt;
Lets list all shells and their subprocesses:&lt;br /&gt;
&lt;br /&gt;
$ ps auf&lt;br /&gt;
USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND&lt;br /&gt;
user        2000  1.3  0.5  10168  5236 pts/1    Ss   22:11   0:00 -bash&lt;br /&gt;
user        2001  0.0  0.3  10620  3304 pts/1    R+   22:11   0:00  \_ ps auf&lt;br /&gt;
user        1000  0.0  0.5  10168  5132 pts/0    Ss   22:00   0:00 -bash&lt;br /&gt;
user        1001  5.8 16.0  46639 15839 pts/0    Sl+  22:00   0:03  \_ aptitude&lt;br /&gt;
root         820  0.0  0.1   5836  1840 tty1     Ss+  22:00   0:00 /sbin/agetty -o -p -- \u --noclear tty1 linux&lt;br /&gt;
root         810  0.0  0.2   7360  2260 ttyS0    Ss+  22:00   0:00 /sbin/agetty -o -p -- \u --keep-baud 115200,38400,9600 ttyS0 vt220&lt;br /&gt;
&lt;br /&gt;
There are 2 bash shells:&lt;br /&gt;
the current pts/1 one with PID 2000 running ps auf&lt;br /&gt;
and the old broken pts/0 one with PID 1000 running aptitude&lt;br /&gt;
&lt;br /&gt;
Lets reconnect to the old one with reptyr:&lt;br /&gt;
&lt;br /&gt;
$ sudo reptyr -T 1000&lt;br /&gt;
&lt;br /&gt;
This way we gain access to the old shell and its subprocesses.&lt;br /&gt;
Since aptitude uses ncurses, you may need to press Ctrl+L or resize the terminal emulator's window to force it to repaint itself.&lt;br /&gt;
Now we can quit aptitude, and then exit the old shell (1000),&lt;br /&gt;
thus returning to our new shell (2000) with only 1 connection remaining, which is the current one:&lt;br /&gt;
&lt;br /&gt;
$ who&lt;br /&gt;
user     pts/1        2022-02-22 22:11 (aaa.bbb.ccc.new)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Source: https://serverfault.com/questions/19634/how-to-reconnect-to-a-disconnected-ssh-session&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Ангилал:Linux]][[Ангилал:Сисадмин]]&lt;/div&gt;</summary>
		<author><name>Almas</name></author>	</entry>

	</feed>