会话恢复
多窗口
会话共享
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43mkdir -p /media/cdrom mount /dev/cdrom /media/cdrom mount: /dev/sr0 is write-protected, mounting read-only vim /etc/yum.repos.d/rhel7.repo [rhel7] name=rhel7 baseurl=file:///media/cdrom enabled=1 gpgcheck=0 yum install screen Loaded plugins: langpacks, product-id, subscription-manager This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. rhel | 4.1 kB 00:00 Resolving Dependencies --> Running transaction check ---> Package screen.x86_64 0:4.1.0-0.19.20120314git3c2946.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved =============================================================================== Package Arch Version Repository Size =============================================================================== Installing: screen x86_64 4.1.0-0.19.20120314git3c2946.el7 rhel 551 k Transaction Summary =============================================================================== Install 1 Package Total download size: 551 k Installed size: 914 k Is this ok [y/d/N]: y Downloading packages: Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : screen-4.1.0-0.19.20120314git3c2946.el7.x86_64 1/1 Verifying : screen-4.1.0-0.19.20120314git3c2946.el7.x86_64 1/1 Installed: screen.x86_64 0:4.1.0-0.19.20120314git3c2946.el7 Complete!
-S 创建会话窗口
-d 将指定会话进行离线处理
-r 回复指定会话
-x 一次性恢复所有会话
-ls 显示当前已有会话
-wipe 把目前无法使用的会话删除
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54screen -S backup screen -ls There is a screen on: 32230.backup (Attached) 1 Socket in /var/run/screen/S-root. exit [screen is terminating] screen vim memo.txt welcome to linuxprobe.com screen -S linux tail -f /var/log/messages Feb 20 11:20:01 localhost systemd: Starting Session 2 of user root. Feb 20 11:20:01 localhost systemd: Started Session 2 of user root. Feb 20 11:21:19 localhost dbus-daemon: dbus[1124]: [system] Activating service name='com.redhat.SubscriptionManager' (using servicehelper) Feb 20 11:21:19 localhost dbus[1124]: [system] Activating service name='com. redhat.SubscriptionManager' (using servicehelper) Feb 20 11:21:19 localhost dbus-daemon: dbus[1124]: [system] Successfully activated service 'com.redhat.SubscriptionManager' Feb 20 11:21:19 localhost dbus[1124]: [system] Successfully activated service 'com. redhat.SubscriptionManager' Feb 20 11:30:01 localhost systemd: Starting Session 3 of user root. Feb 20 11:30:01 localhost systemd: Started Session 3 of user root. Feb 20 11:30:43 localhost systemd: Starting Cleanup of Temporary Directories... Feb 20 11:30:43 localhost systemd: Started Cleanup of Temporary Directories. screen -ls There is a screen on: 13469.linux (Detached) 1 Socket in /var/run/screen/S-root. screen -r linux tail -f /var/log/messages Feb 20 11:20:01 localhost systemd: Starting Session 2 of user root. Feb 20 11:20:01 localhost systemd: Started Session 2 of user root. Feb 20 11:21:19 localhost dbus-daemon: dbus[1124]: [system] Activating service name='com.redhat.SubscriptionManager' (using servicehelper) Feb 20 11:21:19 localhost dbus[1124]: [system] Activating service name='com. redhat.SubscriptionManager' (using servicehelper) Feb 20 11:21:19 localhost dbus-daemon: dbus[1124]: [system] Successfully activated service 'com.redhat.SubscriptionManager' Feb 20 11:21:19 localhost dbus[1124]: [system] Successfully activated service 'com.redhat.SubscriptionManager' Feb 20 11:30:01 localhost systemd: Starting Session 3 of user root. Feb 20 11:30:01 localhost systemd: Started Session 3 of user root. Feb 20 11:30:43 localhost systemd: Starting Cleanup of Temporary Directories... Feb 20 11:30:43 localhost systemd: Started Cleanup of Temporary Directories. Feb 20 11:40:01 localhost systemd: Starting Session 4 of user root. Feb 20 11:40:01 localhost systemd: Started Session 4 of user root.
#临时断开(detach)
#重新连接(attach)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18ssh 192.168.10.10 The authenticity of host '192.168.10.10 (192.168.10.10)' can't be established. ECDSA key fingerprint is 70:3b:5d:37:96:7b:2e:a5:28:0d:7e:dc:47:6a:fe:5c. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.10.10' (ECDSA) to the list of known hosts. root@192.168.10.10's password: 此处输入root管理员密码 Last login: Wed May 4 07:56:29 2017 screen -S linuxprobe ssh 192.168.10.10 The authenticity of host '192.168.10.10 (192.168.10.10)' can't be established. ECDSA key fingerprint is 70:3b:5d:37:96:7b:2e:a5:28:0d:7e:dc:47:6a:fe:5c. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.10.10' (ECDSA) to the list of known hosts. root@192.168.10.10's password: 此处输入root管理员密码 Last login: Wed Feb 22 04:55:38 2017 from 192.168.10.10 screen -x
Copyright ©2010-2022 比特日记 All Rights Reserved.