Exit putty ssh session4/5/2024 ![]() ![]() SSH session hijacking ( ) and arbitrary code injection ( ) attacks already exist and remain possible if ptrace is allowed to operate as before. Firefox, SSH sessions, GPG agent, etc) to extract additional credentials and continue to expand the scope of their attack without resorting to user-assisted phishing. Pidgin) was compromised, it would be possible for an attacker to attach to other running processes (e.g. One particularly troubling weakness of the Linux process interfaces is that a single user is able to examine the memory and running state of any of their processes. Setting ptrace_scope as 0 is not recommended.Īs Linux grows in popularity, it will become a larger target for malware. This does not mean the process becomes a child of the new shell. Note reptyr only attaches a process to another terminal. Where PID is the PID of the process you want to attach to a new terminal. Please see security considerations below. The setting will be applied at the next reboot. If the file doesn't exist but the /etc/sysctl.d/ directory does, then it's probably enough to create it with the following content: _scope = 0 You can enable it temporarily by doing echo 0 > /proc/sys/kernel/yama/ptrace_scopeĪs root, or permanently by editing the file /etc/sysctl.d/nf, which also contains more information about this setting. On Ubuntu Maverick and higher, this ability is disabled by default for security reasons. Reptyr depends on the ptrace(2) system call to attach to the remote program. (The manual mentions screen, you can use tmux instead, whichever you prefer). Started a long-running process over ssh, but have to leave and don't want to interrupt it? Just start a screen, use reptyr to grab it, and then kill the ssh session and head on home. Reptyr is a utility for taking an existing running program and attaching it to a new terminal. Under the session properties, at the bottom, set "close window on exit" to "always".This is exactly the case man 1 reptyr explicitly mentions: You can force it to close after you terminate your session (regardless of errors), like you would expect it to. Putty by default stays open after a terminal has closed impropely (with an error). It detaches so it is not "backgrounded" in the classical bash job management sense. This might cause putty to appear to hang, when in fact, this is the default behavior for putty. Maybe because there is still a process backgrounded, and logging out with a backgrounded process in most shells exits the process, and may send additional traffic for the closedown portion of the termination of putty (unclean exit/termination). I appreciate the suggestions.įor my own knowledge, it would be interesting to hear why this particular combination of putty and su command is causing the hangup during logout. Any feedback will be most appreciated.Įxcellent advice, and your methods will definitely work. This is my first attempt to use a relatively complicated (for me!) command. One more exit to log out of my normal user account ("xtrj7", the same account as in the code above) and Putty, and it hangs indefinitely.Ĭan anyone point me in the right direction? I am a bash scripting noob, zero experience. I type "exit" at the root prompt, and there's no problem there. This command will start the UT server, so that bit works. Why? Because I've read enough guides on the net about backgrounding processes to be dangerous Seriously, the recommendation to background the server on a linux box when accessing via Putty is contained in a tutorial on. I used the "> /dev/null &" at the tail in order to supress the on-screen logging and background the process. I purposefully broke it into multiple lines for readability, but when entered, it's on one line. & /storage/UT/ut2k4/System/ucc-bin server bin/su - xtrj7 -c "cd /storage/UT/ut2k4/System
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |