解决方法是把输入重定向,查看ssh manual: -n Redirects stdin from /dev/null (actually, prevents reading from stdin). This must be used when ssh is run in the background. A common trick is to use this to run X11 programs on a remote machine. For example, ssh -n shadows.cs.hut.fi emac...
Executing command using nohup in background Here, is a simple scenario wherein, we have runfind command to search for filesin background on ssh session using nohup, after which the task was sent to background with prompt returning immediately givingPIDand jobIDof the process([JOBID] PID). ...
whiletrue;dosleep1;done# This will cause the terminal to hanguntilthe command is killed by the userwhiletrue;dosleep1;done This will run foreverinthe background 另外一个办法是使用一个terminal multiplexer, 这是一个能够增加更多功能到你的terminal session的软件.比较出名的有GUN Screen,tmux 无论你...
-f Requests sshtogotobackgroundjust before command execution. 后台运行,并推荐加上 -n 参数。 -n Redirects stdinfrom/dev/null (actually, prevents readingfromstdin). -f 推荐的,不加这条参数应该也行。 -N Do not executearemote command. 不执行远程命令,专为端口转发度身打造。 然后在浏览器中 如果...
This is often used when sshd is run using systemd. This allows easier monitoring of the process in such environments. Without this option, the SSH server forks and detaches from terminal, making itself a background daemon process. The latter has been the traditional way to run the SSH ...
Sometimes my SSH connection hangs when exiting — the shell (or remote command) exits, but the connection remains open, doing nothing. Quick Fix You're probably using the OpenSSH server, and started a background process on the server which you intended to continue after logging out of the ...
New features in 6.6.3 (TECT-943) ssh-keygen-g3 tool: Improved passphrase handling. Now if --random-pass option is used when generating a new key, the private key is protected with a BASE64 encoded passphrase and the path to <file>.pass is shown in the output. (TECT-920) Command-...
Re: ssh and background processes - processes hang When I run ssh -v the last line of the debug info is:debug1: client_input_channel_req: channel 0 rtype exit-status reply 0It hangs at this point. Do you know if HP keeps older versions off ssh available? I only see 4.30 on soft...
Usesshto execute a command, sayls, on a remote host "my-host", (ssh"my-host""ls") => {:exit0:out"file1\nfile2\n":err"") By default this will use the system ssh-agent to obtain your ssh keys, and it uses your current username, but this can be specified: ...
-f Requests ssh to go to background just before command execution. This is useful if ssh is going to ask for passwords or passphrases, but the user wants it in the background. This implies -n. The recommended way to start X11 programs at a ...