<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Ssh on Michael’s Domain</title><link>https://jeltsch.org/en/tags/ssh/</link><description>Recent content in Ssh on Michael’s Domain</description><generator>Hugo</generator><language>en-us</language><copyright>Copyright © 2002 - 2026 Michael Jeltsch.</copyright><lastBuildDate>Fri, 24 Jul 2026 00:18:18 +0300</lastBuildDate><atom:link href="https://jeltsch.org/en/tags/ssh/index.xml" rel="self" type="application/rss+xml"/><item><title>ProxyJump</title><link>https://jeltsch.org/en/proxyjump/</link><pubDate>Thu, 01 May 2025 00:00:00 +0000</pubDate><guid>https://jeltsch.org/en/proxyjump/</guid><description>&lt;p&gt;Since OpenSSH 7.3, it has been much easier to connect from the outside to Linux computers inside the UH network. With older ssh versions, you needed to use a complicated &amp;ldquo;ProxyCommand&amp;rdquo;, but now it is straightforward:&lt;/p&gt;</description></item><item><title>Ways how to keep a process running after logging out</title><link>https://jeltsch.org/en/screen/</link><pubDate>Sat, 26 Jun 2021 00:00:00 +0000</pubDate><guid>https://jeltsch.org/en/screen/</guid><description>&lt;p&gt;There are many ways how to keep a process running after logging out. Each if them has its own advantages and disadvantages: nohup, disown, screen, tmux, ssh2go, etc. 
 &lt;a href="https://www.gnu.org/software/screen/" target="_blank" rel="noopener noreferrer nofollow"&gt;Screen&amp;nbsp;






 
 
 
 &lt;svg class="svg-inline--fa fas fa-up-right-from-square fa-2xs" fill="currentColor" aria-hidden="true" role="img" viewBox="0 0 512 512" overflow="visible"&gt;&lt;use href="#fas-up-right-from-square"&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;
 is certainly not the most feature-rich and modern solution, but it is available by default on all Linux installations. That&amp;rsquo;s why I use it. Here&amp;rsquo;s how it works:&lt;/p&gt;</description></item><item><title>How to enable passwordless logins to a server</title><link>https://jeltsch.org/en/how_to_enable_passwordless_logins_to_a_server/</link><pubDate>Wed, 24 Jul 2019 00:00:00 +0000</pubDate><guid>https://jeltsch.org/en/how_to_enable_passwordless_logins_to_a_server/</guid><description>&lt;ol&gt;
&lt;li&gt;Enable root login with password on the server. To do so, you need to edit the file /etc/ssh/sshd_config.Modify the lines starting with &amp;ldquo;PermitRootLogin&amp;rdquo; like this:#PermitRootLogin prohibit-passwordPermitRootLogin yes&lt;/li&gt;
&lt;li&gt;Restart the sshd server:sudo systemctl restart sshd&lt;/li&gt;
&lt;li&gt;On the client, copy the public key files to the server with the ssh-copy-id command:ssh-copy-id root@server&lt;/li&gt;
&lt;li&gt;On the server, disable root login with password and enable root login with public key authentication:PermitRootLogin prohibit-password#PermitRootLogin yes&lt;/li&gt;
&lt;/ol&gt;</description></item><item><title>Passwordless login via the GUI and ssh defaults</title><link>https://jeltsch.org/en/passwordless/</link><pubDate>Mon, 25 Mar 2019 00:00:00 +0000</pubDate><guid>https://jeltsch.org/en/passwordless/</guid><description>&lt;p&gt;I use cloud services at 
 &lt;a href="https://csc.fi" target="_blank" rel="noopener noreferrer nofollow"&gt;CSC&amp;nbsp;






 
 
 
 &lt;svg class="svg-inline--fa fas fa-up-right-from-square fa-2xs" fill="currentColor" aria-hidden="true" role="img" viewBox="0 0 512 512" overflow="visible"&gt;&lt;use href="#fas-up-right-from-square"&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;
 (e.g. pouta.csc.fi), and they do not allow SSH login with a traditional username/password combo. When I want to make a bookmark in my file manager (Nemo oder Nautilus/Files), pointing to this location. I need to specify an RSA key file that is used for the login. On the command line, it looks as follows:&lt;/p&gt;</description></item><item><title>BackupPC and Macs</title><link>https://jeltsch.org/en/backuppc_and_macs/</link><pubDate>Wed, 13 Apr 2016 00:00:00 +0000</pubDate><guid>https://jeltsch.org/en/backuppc_and_macs/</guid><description>&lt;p&gt;I myself have been using the backup software 
 &lt;a href="http://backuppc.sourceforge.net/" target="_blank" rel="noopener noreferrer nofollow"&gt;BackupPC&amp;nbsp;






 
 
 
 &lt;svg class="svg-inline--fa fas fa-up-right-from-square fa-2xs" fill="currentColor" aria-hidden="true" role="img" viewBox="0 0 512 512" overflow="visible"&gt;&lt;use href="#fas-up-right-from-square"&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;
 for almost a decade, and I started to backup our lab computers to a central backup server about two years ago. BackupPC supports deduplication and therefore much data can be stored on a couple of 2 TB drives.BackupPC supports many protocols (smb, ftp, tar/rsync via ssh), but we mostly use rsync via ssh. The data is not encrypted before the backup. Strangely not even the upcoming version 4 will support pre-egression encryption. However, we store the backup on an encrypted volume. That way it is at least protected if the backup server is stolen. And during transit, the data is protected by ssh. However, the system is not 
 &lt;a href="https://en.wikipedia.org/wiki/Trust_no_one_%28Internet_security%29" target="_blank" rel="noopener noreferrer nofollow"&gt;TNO&amp;nbsp;






 
 
 
 &lt;svg class="svg-inline--fa fas fa-up-right-from-square fa-2xs" fill="currentColor" aria-hidden="true" role="img" viewBox="0 0 512 512" overflow="visible"&gt;&lt;use href="#fas-up-right-from-square"&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;
 (&amp;ldquo;trust no-one&amp;rdquo;), since I (as the backupc administrator) can access the files. When using Linux, one feasible method would be to encrypt the user&amp;rsquo;s home directory using 
 &lt;a href="http://ecryptfs.org/" target="_blank" rel="noopener noreferrer nofollow"&gt;eCryptFS&amp;nbsp;






 
 
 
 &lt;svg class="svg-inline--fa fas fa-up-right-from-square fa-2xs" fill="currentColor" aria-hidden="true" role="img" viewBox="0 0 512 512" overflow="visible"&gt;&lt;use href="#fas-up-right-from-square"&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;
 (which is an inbuilt option when creating users on 
 &lt;a href="http://www.ubuntu.com/" target="_blank" rel="noopener noreferrer nofollow"&gt;Ubuntu&amp;nbsp;






 
 
 
 &lt;svg class="svg-inline--fa fas fa-up-right-from-square fa-2xs" fill="currentColor" aria-hidden="true" role="img" viewBox="0 0 512 512" overflow="visible"&gt;&lt;use href="#fas-up-right-from-square"&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;
) and then backup the /home/.ecryptfs directory instead of the users home directory. However, recovery would be much more of a problem. You would be able to browse the diectory structure and files of the backup, but the filenames would be meaningless since they are also encrypted in the process.There is one peculiarity in backing up Mac OSX machines: BackupPC normally connects as root via ssh into the client computer and executes the rsync backup command. In order to make this possible on university-managed Mac OSX computers, we had to create a dedicated user (&amp;ldquo;backuppc&amp;rdquo;) on the client machines and allow for this user the execution of rsync with root privileges, which is done by adding this line in the /etc/sudoers file:&lt;code&gt;backuppc ALL=NOPASSWD: /usr/bin/rsync&lt;/code&gt;. Then we have to change the ssh/rsync command for the Mac client on the backuppc server changing &amp;ldquo;root&amp;rdquo; into &amp;ldquo;backuppc&amp;rdquo;.&lt;/p&gt;</description></item><item><title>x11vnc as a nxserver replacement</title><link>https://jeltsch.org/en/x11vnc_as_a_nxserver_replacement/</link><pubDate>Thu, 29 Nov 2012 00:00:00 +0000</pubDate><guid>https://jeltsch.org/en/x11vnc_as_a_nxserver_replacement/</guid><description>&lt;p&gt;Now that 
 &lt;a href="http://www.nomachine.com" target="_blank" rel="noopener noreferrer nofollow"&gt;nomachine&amp;nbsp;






 
 
 
 &lt;svg class="svg-inline--fa fas fa-up-right-from-square fa-2xs" fill="currentColor" aria-hidden="true" role="img" viewBox="0 0 512 512" overflow="visible"&gt;&lt;use href="#fas-up-right-from-square"&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;
&amp;rsquo;s great nxclient is defunct on MacOS X and its new nxplayer is still in beta (and completely nonfunctional on my setup), I needed another solution to connect to my work desktop from home. I tried many things, but then settled for 
 &lt;a href="http://www.karlrunge.com/x11vnc/" target="_blank" rel="noopener noreferrer nofollow"&gt;x11vnc&amp;nbsp;






 
 
 
 &lt;svg class="svg-inline--fa fas fa-up-right-from-square fa-2xs" fill="currentColor" aria-hidden="true" role="img" viewBox="0 0 512 512" overflow="visible"&gt;&lt;use href="#fas-up-right-from-square"&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;
. My work desktop is running Ubuntu Precise Pangolin (12.04) and I connect from a MacOS X 10.8 (Mountain Lion). I only had to install x11vnc and openssh-server on my work desktop and add an x11vnc.conf file to /etc/init with the following content:&lt;code&gt;x11vnc -forever -rfbauth /etc/x11vnc.pass -bg -o /var/log/x11vnc.log -scale 1280x800 -display :0 -auth /var/run/lightdm/root/:0&lt;/code&gt;I have to create the password file:&lt;code&gt;x11vnc -storepasswd password /etc/x11vnc.pass&lt;/code&gt;Then I just have to get into my work desktop by some means or another. At the moment I jump there via the UNIX computers of the university, because direct ssh access is not possible because of a firewall. So I ssh into the UNIX mainframe and from there I ssh into my work computer. Once I am in, I establish a reverse ssh tunnel to my Macbook Pro at home:&lt;code&gt;ssh -R 19999:localhost:5900 IP_address_of_homecomputer&lt;/code&gt;On my Macbook at home I had to enable Sharing - Remote login first. Then I just use the inbuilt Screen sharing of the OS &amp;ldquo;Connect to server&amp;rdquo; and then I type &amp;ldquo;vnc://localhost:19999&amp;rdquo; and voila I can see my work desktop&amp;rsquo;s login screen.Alternatively I could use my openvpn server that I have installed on my Macbook and use an openvpn client on my work desktop to establish a connection to my Macbook. Then I could directly log in and avoid the hops via the university UNIX machines to set up the reverse ssh tunnel.Another, although very slow method to access the GUI of my work desktop is X11 forwarding via ssh. All I need is a working ssh connection to the server, X11 forwarding enabled in the ssh server configuration file and an X11 server on the local machine (e.g. XQuarz on MacOSX):&lt;code&gt;ssh -X username@remote-server.comxclock &amp;amp;&lt;/code&gt;&lt;/p&gt;</description></item><item><title>tar copying via ssh</title><link>https://jeltsch.org/en/tar_copying_via_ssh/</link><pubDate>Fri, 26 Sep 2008 00:00:00 +0000</pubDate><guid>https://jeltsch.org/en/tar_copying_via_ssh/</guid><description>&lt;p&gt;&lt;code&gt;tar czv sourcepath | ssh -l username 192.168.0.5 tar xz -C targetpath&lt;/code&gt;&lt;/p&gt;</description></item><item><title>VNC (Virtual Network Computing) via ssh</title><link>https://jeltsch.org/en/vnc_virtual_network_computing_via_ssh/</link><pubDate>Sat, 26 May 2007 00:00:00 +0000</pubDate><guid>https://jeltsch.org/en/vnc_virtual_network_computing_via_ssh/</guid><description>&lt;p&gt;I am sitting at home and want to use the GUI of my Linux at work. But my work computer which is running the VNC server (mcblpc2.hi.helsinki.fi) is behind the University firewall. The only connection I can get into the firewall is via one of the university mainframes, e.g. vesuri.helsinki.fi. In order to connect using VNC, I need just two commands:&lt;code&gt;ssh -L 5901:mcblpc2.hi.helsinki.fi:5901 mjeltsch@vesuri.helsinki.fivncviewer localhost:1&lt;/code&gt;To make the connection faster, you can use compression (helps only if you have a slow connection, e.g. a modem). When using VNC with ssh, the vncviewer really thinks you make a connection to the local machine and therefore chooses a wrong encoding. So the second command actually should be: &lt;code&gt;vncviewer localhost:1 -compresslevel 0 -encodings &amp;quot;copyrect hextile&amp;quot;&lt;/code&gt;When you run the vncserver on a computer that has its own firewall, you need to have sshd running and to open the ssh port (22). Then you establish a tunnel from that ssh server on that computer to a port on your local computer:&lt;code&gt;ssh -L 5901:remotemachine:5901 username@remotemachine vncviewer localhost:1&lt;/code&gt;When you run KDE desktop sharing on Suse 9.0, you share the physical screen (:0). Thus, if you are logged out, you cannot connect using desktop sharing. You have to start up additionally a vnvserver instance:&lt;code&gt;vncserver&lt;/code&gt;This server will use by default the :1 session and that&amp;rsquo;s why the forwarded port must be 5901 and not 5900 (like for the first session).&lt;/p&gt;</description></item><item><title>ssh host keys</title><link>https://jeltsch.org/en/ssh_host_keys/</link><pubDate>Wed, 23 May 2007 00:00:00 +0000</pubDate><guid>https://jeltsch.org/en/ssh_host_keys/</guid><description>&lt;p&gt;When reinstalling an ssh server, one should keep the ssh key files from the old system. Otherwise ssh clients will receive messages of like &amp;ldquo;IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!&amp;rdquo;. If you didn&amp;rsquo;t keep the files, the clients can of course delete the entries from the host key file (usually /home/user/.ssh/known_hosts). When the user connects after that again to the server, the new, changed host key files are added to the host key file.&lt;/p&gt;</description></item><item><title>Execution of dd command via ssh and output redirection to local file</title><link>https://jeltsch.org/en/execution_of_dd_command_via_ssh_and_output_redirection_to_local_file/</link><pubDate>Wed, 04 Apr 2007 00:00:00 +0000</pubDate><guid>https://jeltsch.org/en/execution_of_dd_command_via_ssh_and_output_redirection_to_local_file/</guid><description>&lt;p&gt;I wanted to copy a whole encrypted partition over the network into a file. You can execute many commands via ssh, but occasionally there are problems to direct the output where you want it. E.g. the &amp;ldquo;more&amp;rdquo; command doesn&amp;rsquo;t output to standard out when used via ssh. You need to use &amp;ldquo;less&amp;rdquo; to get the file content displayed locally (at least using a RedHat 8 remote machine). With dd you cannot use the &amp;ldquo;dd if=input of=output&amp;rdquo; syntax but you need the &amp;ldquo;dd output&amp;rdquo; syntax. The command I finally managed with is &lt;code&gt;ssh -l root remote-machine 'dd hda1.bin&lt;/code&gt;&lt;/p&gt;</description></item><item><title>Tunneling of remote X11 output to a local machine behind a firewall (ssh, X11, ForwardX11)</title><link>https://jeltsch.org/en/tunneling_of_remote_x11_output_to_a_local_machine_behind_a_firewall_ssh_x11_forwardx11/</link><pubDate>Wed, 04 Apr 2007 00:00:00 +0000</pubDate><guid>https://jeltsch.org/en/tunneling_of_remote_x11_output_to_a_local_machine_behind_a_firewall_ssh_x11_forwardx11/</guid><description>&lt;p&gt;If X11 forwarding is globally disallowed in your local machine, you need to override this by editing ~/.ssh/config: &lt;code&gt;Host hostname.domain.org ForwardX11 yes&lt;/code&gt; Then you just ssh into the remote machine hostname.domain.org: &lt;code&gt;ssh -X username@hostname.domain.org&lt;/code&gt; And execute some program that outputs to X11, e.g.: &lt;code&gt;xclock &amp;amp;&lt;/code&gt;&lt;/p&gt;</description></item><item><title>Using ssh in scripts (one-click secure VNC connection using krdc)</title><link>https://jeltsch.org/en/using_ssh_in_scripts_one_click_secure_vnc_connection_using_krdc/</link><pubDate>Thu, 29 Mar 2007 00:00:00 +0000</pubDate><guid>https://jeltsch.org/en/using_ssh_in_scripts_one_click_secure_vnc_connection_using_krdc/</guid><description>&lt;p&gt;Using ssh in scripts (one-click secure VNC connection using krdc) I wanted to establish a VNC connection that is tunneled via ssh and just by one click. I created a shell script with the following content: !/bin/sh ssh -L 5902:192.168.0.7:5902 -f -N 
 &lt;a href="mailto:jeltsch@192.168.0.7"&gt;jeltsch@192.168.0.7&lt;/a&gt;
 krdc localhost:2 The ssh connection remains open in the background until the krdc application has finished.&lt;/p&gt;</description></item></channel></rss>