<?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 Dapeng Zhang</title><link>https://zhangdapeng.dev/tags/ssh/</link><description>Recent content in SSH on Dapeng Zhang</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Tue, 01 Jul 2025 15:04:13 +0000</lastBuildDate><atom:link href="https://zhangdapeng.dev/tags/ssh/index.xml" rel="self" type="application/rss+xml"/><item><title>配置多个ssh key的遇到的问题</title><link>https://zhangdapeng.dev/p/pei-zhi-duo-ge-ssh-key-de-yu-dao-de-wen-ti/</link><pubDate>Tue, 01 Jul 2025 15:04:13 +0000</pubDate><guid>https://zhangdapeng.dev/p/pei-zhi-duo-ge-ssh-key-de-yu-dao-de-wen-ti/</guid><description>&lt;h1 id="配置多个ssh-key的遇到的问题"&gt;&lt;a class="link" href="#1" &gt;配置多个ssh key的遇到的问题&lt;/a&gt;
&lt;/h1&gt;&lt;p&gt;1，Bad owner or permissions on .ssh/config&lt;/p&gt;
&lt;p&gt;2，进行测试的时候总会出现提示输入密码&lt;/p&gt;
&lt;p&gt;以上两个问题多数是由于权限的问题&lt;/p&gt;
&lt;p&gt;解决问题一：&lt;/p&gt;
&lt;p&gt;将config的执行权限修改为600&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo chmod &lt;span style="color:#ae81ff"&gt;600&lt;/span&gt; ~/.ssh/config
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;解决问题二:&lt;/p&gt;
&lt;p&gt;这个问题在我这里出现的原因是由于我将config拥有权限改成了root，导致出现的问题&lt;/p&gt;
&lt;p&gt;如果你也遇到这样的问题的话，可以试着改成拥有权限为自己就可以了。&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo chown xxx ~/.ssh/config
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;[xxx]为linux的当前用户&lt;/p&gt;
&lt;p&gt;执行完之后在测试下，是不是已经就成功了，没有的话可以加群沟通&lt;/p&gt;</description></item><item><title>Proxy Firefox through a SSH tunnel</title><link>https://zhangdapeng.dev/p/proxy-firefox-through-a-ssh-tunnel/</link><pubDate>Tue, 01 Jul 2025 11:54:31 +0000</pubDate><guid>https://zhangdapeng.dev/p/proxy-firefox-through-a-ssh-tunnel/</guid><description>&lt;p&gt;&lt;strong&gt;a fast, privately secured tunnel to transfer web pages and dns queries&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Have you ever wanted to visit sites during the day from a location that denied access to those sites? Perhaps the company has denied access due to bandwidth considerations or you might have decided that the site you want to go to might not always be work safe depending on the story or pictures? What you need is the ability to create a secure and encrypted ssh connection to tunnel your browser traffic through.&lt;/p&gt;
&lt;p&gt;Using a ssh tunnel to retrieve the data from websites is significantly faster than trying to use X forwarding to open a remote copy of Firefox on the remote machine. If a remote browser is used the connection will be saturated by the graphical front end of the remote browser window. Use the tunnel for the web site&amp;rsquo;s data and leave the rendering of the browser to the local machine. This is the most efficient solution.&lt;/p&gt;
&lt;p&gt;If you have access to a remote machine by way of ssh you can set up Firefox, or any other SOCKS v5 enabled application, to tunnel its connection through ssh. This way, if you were at work and wanted to browse your favorite sites like MySpace, Facebook or Maxim that are blocked at the company firewall you could.&lt;/p&gt;
&lt;p&gt;Getting Started&lt;/p&gt;
&lt;p&gt;First you must have ssh access to the remote machine you want to proxy to. Let it be a home machine or a free shell you signed up for on-line. You must also make sure you can ssh from where your browser is to where you want to tunnel to. No need to set this up if port 22 is not open to you from your location to your destination.&lt;/p&gt;
&lt;p&gt;ATTENTION: We are proud to announce our Firefox add-on called, &amp;ldquo;Calomel SSL Validation&amp;rdquo;. It will grade the security of your SSL connection. The link has screen shots too!&lt;/p&gt;
&lt;p&gt;IMPORTANT NOTE: The Firefox tunnel using SOCKS5 (option 1) is the easiest and quickest proxy to setup. If you just want to get the proxy working then follow the SOCKS5 options.&lt;/p&gt;
&lt;p&gt;Configure Firefox for the proxy&lt;/p&gt;
&lt;p&gt;You need to configure Firefox to use the proxy. Find the section to add a proxy to the browser. On *nix systems of Firefox you will find the settings in File, Preferences, Advanced, Network, Settings. The setting by default is &amp;ldquo;Direct Connection to the Internet&amp;rdquo;. We need to setup the &amp;ldquo;Manual proxy configuration&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;You have two(2) options to pick from. You can proxy directly to the remote machine and then connect directly to web sites. This is the SOCKS5 method and is the easiest to setup. Or, you could use a Squid web proxy (if available) on the remote machine to accept the traffic from the ssh tunnel. Squid would then request the traffic from web sites. Pick one of the options below.&lt;/p&gt;
&lt;p&gt;NOTE: For our example, ssh is going to listen on localhost (127.0.0.1) and port 8080 of the local machine.&lt;/p&gt;
&lt;p&gt;Option 1: ssh and direct connect (SOCKS5) : If you are going to use the ssh tunnel with the option &amp;ldquo;-D 8080&amp;rdquo; then you need to setup the browser to use a SOCKS5 proxy. Setup the proxy config page with the following entries and leave the rest of the entries blank.&lt;/p&gt;
&lt;p&gt;Manual proxy configuration:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;SOCKS Proxy 127.0.0.1 Port &lt;span style="color:#ae81ff"&gt;8080&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;check the box &lt;span style="color:#66d9ef"&gt;for&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;SOCKS v5&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Option 2: ssh tunnel to squid proxy (HTTP/SSL Proxy) : If you are going to use the ssh tunnel with the option &amp;ldquo;-L 8080:localhost:2020&amp;rdquo; to connect to the remote machine&amp;rsquo;s Squid proxy then configure the browser to use a HTTP/SSL proxy. Setup the proxy config page with the following entries and leave the rest of the entries blank.&lt;/p&gt;
&lt;p&gt;Manual proxy configuration:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;HTTP Proxy: 127.0.0.1 Port &lt;span style="color:#ae81ff"&gt;8080&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;SSL Proxy : 127.0.0.1 Port &lt;span style="color:#ae81ff"&gt;8080&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Optional Step: DNS proxying through SOCKS5 is highly recommended&lt;/p&gt;
&lt;p&gt;This step is optional, but since we are going to be proxying the data over the ssh tunnel then we should also proxy the DNS requests as well. The purpose of this exercise is to get to a site we might not otherwise be able to retrieve or just to anonymize our browsing from your location. If we tunneled our data through ssh and then asked the local DNS server for the ips it would defeat the purpose. So, add a boolean option into the URL &amp;ldquo;about:config&amp;rdquo; page in Firefox. Name the entry &amp;ldquo;network.proxy.socks_remote_dns&amp;rdquo; and set it to true.&lt;/p&gt;
&lt;p&gt;This method will only take affect if you use the SOCKS5 proxy method. If you are proxying using the squid method (HTTP/SSL Proxy) you could always check if you can query another, independent DNS server like OpenDNS.&lt;/p&gt;
&lt;p&gt;##Preference Name Status Type Value&lt;/p&gt;
&lt;p&gt;network.proxy.socks_remote_dns user set boolean true&lt;/p&gt;
&lt;p&gt;Making the ssh tunnel&lt;/p&gt;
&lt;p&gt;Lastly, we need to start the ssh tunnel. You have two choices depending if you want the packets to be forwarded to squid on the remote machine or not.&lt;/p&gt;
&lt;p&gt;Option 1: ssh and direct connect (SOCKS5) : The following line will start the ssh client and connect to username@remote_machine.com. Port 8080 on localhost (127.0.0.1) will listen for requests and send them to the remote machine. The remote machine will then send the packets out as if they originated from itself. The ssh options are in the man page of ssh, but to summarize them in order: Compression, SSH2 only, Quite, Force pseudo-tty allocation, Redirect stdin from /dev/null, and Place the ssh client into &amp;ldquo;master&amp;rdquo; mode for connection sharing.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ssh -C2qTnN -D &lt;span style="color:#ae81ff"&gt;8080&lt;/span&gt; username@remote_machine.com
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Option 2: ssh to squid proxy (HTTP/SSL Proxy) : The following line will also start the ssh client and connect to username@remote_machine.com. Port 8080 on localhost (127.0.0.1) on the current machine will listen for requests and ssh tunnel them to the remote machine. On the remote machine ssh will forward the packets to localhost port 2020. If squid is listening on localhost port 2020 on the remote machine then all requests sent though the ssh tunnel will then be forwarded to squid. You can use squid to block ads and speed up web access. If you need assistance with squid, check out the Calomel.org Squid &amp;ldquo;how to&amp;rdquo; page.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ssh -C2qTnN -L 8080:localhost:2020 username@remote_machine.com
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Testing the ssh tunnel&lt;/p&gt;
&lt;p&gt;Once you execute the ssh line the encrypted and compressed ssh tunnel will be active in the xterm. We used the &amp;ldquo;quiet&amp;rdquo; options in ssh so there will not be any logging or output to the terminal.&lt;/p&gt;
&lt;p&gt;Make sure Firefox is working by checking the proxy is active and then try to go to a web page. You can also try a site like WhatIsMyIp.com to verify the ip you have with the proxy is different than without.&lt;/p&gt;
&lt;p&gt;If everything is working then you can be assured that all of your browsing traffic is being encrypted through the tunnel and no one at your current location will be able to see your traffic over the network.&lt;/p&gt;
&lt;p&gt;Once you are done with the proxy just exit the ssh xterm or kill this instance of ssh with Ctrl-c. Remember to set Firefox back to &amp;ldquo;Direct Connection&amp;rdquo; if you want to directly browse from your location otherwise you will not be going anywhere.&lt;/p&gt;
&lt;p&gt;Interested in setting up Squid or Samba? Check out our guides covering the Squid Proxy and Samba file share servers. We offer clear explanations and fully working example configurations.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Questions?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;How can I setup two or more ssh tunnels through two or more machines ?&lt;/p&gt;
&lt;p&gt;At some point you may need to tunnel through multiple ssh tunnels through multiple machines. This is quite easy to do as long as you have ssh access to every machine you want to tunnel through. In this example we will be tunneling from a desktop machine through a machine called host1 and then to a machine called host2 which will then access the internet. Something like so:&lt;/p&gt;
&lt;p&gt;Firefox desktop -&amp;gt; host1 -&amp;gt; host2 -&amp;gt; internet&lt;/p&gt;
&lt;p&gt;First, make sure you went through the beginning on this page and know how to get firefox to proxy through a SOCKS5 proxy on localhost port 8080. Then run the following ssh command on the desktop running Firefox. This will setup an encrypted ssh tunnel to host1 from the &amp;ldquo;Firefox desktop&amp;rdquo;.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;desktop$ ssh -C2qTnN username@host1 -L 8080:localhost:8080
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now, you need to ssh to host1 directly. Once you are on host1 run the following. This will collect any data from the first tunnel originating from the &amp;ldquo;Firefox desktop&amp;rdquo; to host1 and tunnel that data to host2.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;host1$ ssh -C2qTnN -D &lt;span style="color:#ae81ff"&gt;8080&lt;/span&gt; username@host2
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;So, how does this setup work? Firefox on the desktop will initiate a SOCKS5 connection to localhost port 8080 on the desktop machine. Since a ssh tunnel is listening on localhost:8080 it will ssh tunnel the traffic to host1 which will forward this traffic to host1&amp;rsquo;s localhost:8080. On host1 the second ssh command will tunnel all traffic it receives on localhost:8080 from the desktop machine to host2. On host2 the traffic will then be able to go out to the internet at large. If you have DNS SOCKS5 resolution on as well then all web traffic &lt;em&gt;and&lt;/em&gt; dns queries will goto host2 through both tunnels. From the view of the internet all queries originating from the &amp;ldquo;Firefox desktop&amp;rdquo; will look like they come from host2. Nice and anonymous.&lt;/p&gt;
&lt;p&gt;What if I need to tunnel through more then two machines? Then just keep repeating &amp;ldquo;ssh -C2qTnN username@host1 -L 8080:localhost:8080&amp;rdquo; command for each incremental host. Once you decide you very last host you want the data to access the internet with then use the &amp;ldquo;ssh -C2qTnN -D 8080 username@host2&amp;rdquo; command.&lt;/p&gt;
&lt;p&gt;To make sure you tunnel is working correctly using a site like ipchicken.com to see what ip address you are coming from. In the case of our example above ipchicken should report the ip address of host2.&lt;/p&gt;
&lt;p&gt;Do you have any recommended modifications for Firefox in &amp;ldquo;about:config&amp;rdquo; ?&lt;/p&gt;
&lt;p&gt;First, make sure to check out our Firefox Add-on &amp;ldquo;Calomel SSL Validation&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;More open proxy connections: When you use a proxy, Firefox limits the amount of concurrent open connections to 8. This is too small for most users as many people open multiple tabs to many sites. When more then 8 connections are made the browser seems to be &amp;ldquo;stuck&amp;rdquo; because Firefox will wait till an open connection is closed before making a new one. To avoid this problem it is highly suggested to increase the persistent connections value from 8 to 25.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;network.http.max-persistent-connections-per-proxy &lt;span style="color:#ae81ff"&gt;25&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Turn off pop-up tips: If you are annoyed by pop up text when your mouse hovers over a web element you can turn that function off.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;browser.chrome.toolbar_tips false
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;No animations: Stop all animated gifs and pictures like ads and annoying dancing cartoons characters.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;image.animation_mode none
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;No blinking text: Blinking text is annoying. Webmasters should not use it. In case they do, we will disallow the function in the browser.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;browser.blink_allowed false
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Parallel connections: An easy way to speed up Firefox is to increase the amount of parallel connections the browser makes to the server. Open up Firefox and type in &amp;ldquo;about:config&amp;rdquo; in the URL. Then search for the string &amp;ldquo;conn&amp;rdquo; You should see the following entries listed. Modify them as follows:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;network.http.max-connections &lt;span style="color:#ae81ff"&gt;25&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;network.http.max-connections-per-server &lt;span style="color:#ae81ff"&gt;25&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;network.http.max-persistent-connections-per-proxy &lt;span style="color:#ae81ff"&gt;25&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;network.http.max-persistent-connections-per-server &lt;span style="color:#ae81ff"&gt;25&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It is &lt;em&gt;not&lt;/em&gt; recommended to use more then 25 parallel connections due to abuse of the remote server and concurrency bottlenecks on the local system. Understand that if you have a slow system then more parallel connections can actually slow the browser down considerably. Also, if you try to open too many connections to a server then that server many consider you hostile and block or blacklist you.&lt;/p&gt;
&lt;p&gt;Pipelining Enabled: The fastest and most efficient way to implement a browser is to use pipelining. This is where a single persistent connection is used, but instead of waiting for each response before sending the next request, several requests are sent out at a time. This reduces the amount of time the client and server are waiting for requests or responses to cross the network. Pipelined requests with a single connection are faster than multiple HTTP/1.0 requests in parallel, and considerably reduce the number of packets transmitted across the network. Apache supports both HTTP/1.0 keep-alive and HTTP/1.1 persistent connections. Pipelining is implement entirely at the browser end if supported by the remote web server, using persistent connections.&lt;/p&gt;
&lt;p&gt;To enable pipelining in Firefox browser goto the url about:config . Then search for &amp;ldquo;pipe&amp;rdquo; and set the following:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;network.http.pipelining true
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;network.http.pipelining.maxrequests &lt;span style="color:#ae81ff"&gt;8&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;network.http.pipelining.ssl true
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;network.http.proxy.pipelining true
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;TLSv1 with AES256, AES128 and 3DES 168 Only: When connecting to SSL based servers (https) you only want to use the strongest ciphers available. Most web server admins can setup their servers to prefer weak ciphers over strong ciphers for any reason; sometimes they want a less CPU intensive encryption or perhaps they just configured the server wrong. Even Google&amp;rsquo;s encrypted pages prefer RC4 instead of AES and this is not our idea of good security. We want to make sure that our version of Firefox only uses AES 256 bit, AES 128 bit or 3DES 168 bit ciphers.&lt;/p&gt;
&lt;p&gt;Open up a window and type &amp;ldquo;about:config&amp;rdquo;. Then in the &amp;ldquo;Filter&amp;rdquo; bar at the top search for the following. Double clicking on each line will change the value.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;tls and set the lines to true.

ssl2 and set every line entry to false.

ssl3 and set every line to false _except_ lines containing the strings &amp;quot;aes_256&amp;quot; and &amp;quot;aes_128&amp;quot;.

security.ssl3.rsa_des_ede3_sha and set it to true. This is the weakest cipher and may be needed for some older SSL sites.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now your browser will &lt;em&gt;only&lt;/em&gt; accept the TLSv1 protocol in AES256 bit cipher encryption no matter what previous weaker ciphers a web server prefers. This configuration also makes your browser FIPS 120-2 compliant (year 2030 specs).&lt;/p&gt;
&lt;p&gt;Is there any way I can switch proxies faster?There are add-ons, also called extensions, for Firefox called FoxyProxy or SwitchProxyTool you can use. They offer the ability to setup multiple proxy settings and choose the one you want, or turn them off, using a drop down menu.&lt;/p&gt;
&lt;p&gt;I noticed you use compression in the ssh tunnel proxy. Why?The majority of the data you are retrieving using the browser is text or HTML data. This type of data compresses very well at up to 80%. Using compression in the tunnel will speed up the delivery of the data considerably.&lt;/p&gt;
&lt;p&gt;&lt;a class="link" href="https://calomel.org/firefox_ssh_proxy.html" target="_blank" rel="noopener"
 &gt;https://calomel.org/firefox_ssh_proxy.html&lt;/a&gt;&lt;/p&gt;</description></item><item><title>给vps设置ssh供翻墙使用</title><link>https://zhangdapeng.dev/p/gei-vps-she-zhi-ssh-gong-fan-qiang-shi-yong/</link><pubDate>Mon, 23 Jun 2025 16:26:54 +0000</pubDate><guid>https://zhangdapeng.dev/p/gei-vps-she-zhi-ssh-gong-fan-qiang-shi-yong/</guid><description>&lt;p&gt;在服务器上建一个 username ：&lt;/p&gt;
&lt;p&gt;添加用户：useradd -s /bin/false username，将用户的shell设置成/bin/false。这样用户就无法与系统进行交互。&lt;/p&gt;
&lt;p&gt;设置密码：passwd username&lt;/p&gt;
&lt;p&gt;（对已有帐号禁止其shell交互使用：usermod -s /bin/false username）&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;小技巧：&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;也可以使用 /usr/bin/passwd 作为用户的 shell ，这样用户就可以通过登录而来自主修改密码。需要注意的是，需要将 /usr/bin/passwd 这一行写进 /etc/shells文件。&lt;/p&gt;
&lt;p&gt;sshd 认证通后之后，会检查设定的 shell 是否登记在 /etc/shells 文件中，若已经登记，则fork自己，然后fork出来的子进程再exec 设定的 shell 。而 ssh 的 -N 参数，则是告诉 sshd 不需要执行 shell。（ssh本身可以通过参数来设置连接到 sshd 但是不执行远程命令，默认是启动用户设定的 shell ）。&lt;/p&gt;
&lt;p&gt;（此文章为转载，未做测试，使用请三思）&lt;/p&gt;</description></item><item><title>使用Linode vps的ssh功能来翻墙</title><link>https://zhangdapeng.dev/p/shi-yong-linode-vps-de-ssh-gong-neng-lai-fan-qiang/</link><pubDate>Mon, 23 Jun 2025 16:26:50 +0000</pubDate><guid>https://zhangdapeng.dev/p/shi-yong-linode-vps-de-ssh-gong-neng-lai-fan-qiang/</guid><description>&lt;p&gt;如果你购买了linode 的vps，就可以使用它做代理上国外的网站，比如facebook，twitter等，不用代理，这些网站在国内是无法否则的，原因不用多说。下面是linode设置代理上网的方法：&lt;/p&gt;
&lt;p&gt;1, 打开PuTTY，输入主机名或IP地址。&lt;/p&gt;
&lt;p&gt;2, 切换到Connection -&amp;gt; SSH -&amp;gt; Tunnels ，设定Source port: 7070（端口号随你喜欢,autoproxy有一条7070端口的记录，设置成这个后面就不用加了）; Destination: 空白, Dynamic，设定完记得按Add。&lt;/p&gt;
&lt;p&gt;3，如有需要，可回到Session保存(Save)设定值，以后运行PuTTY时可直接加载(Load)设定值。在任何时候按”Open”即可以目前设定进行连接。&lt;/p&gt;
&lt;p&gt;4，登录SSH后，将PuTTY界面最小化，保持SSH连接。&lt;/p&gt;
&lt;p&gt;5，设置firefox使用putty生成的socks5代理服务器上网。我们先使用firefox试用一下，autoproxy插件根据个人爱好安装。&lt;/p&gt;
&lt;p&gt;运行firefox，选择“工具”-&amp;gt;“选项”，选择“高级”-&amp;gt;“网络”，&lt;/p&gt;
&lt;p&gt;点击“配置Firefox如何连接至因特网”后的“设置…”，弹出对话框，选择sock5，端口填7070。&lt;/p&gt;
&lt;p&gt;6，这一步很关键：&lt;/p&gt;
&lt;p&gt;经过上面的设置，firefox已经能够访问大部分网站了，但仍然不能访问非死不可和推特，这是为什么呢？原 来，非死不可的 dns查询被动了手脚，无论你向哪个dns服务器查询非死不可的ip地址，都会返回一个错误的结果。幸运的是firefox支持让远程服务器解析 dns地址，但是这个功能默认是关闭的。而IE目前却缺少远程解析dns的功能。&lt;/p&gt;
&lt;p&gt;在firefox的地址栏输入“about:config”进入firefox的高级设置页面，过滤器处输入dns后搜索，找到“network.proxy.socks_remote_dns”项，把它的值改为“true”，然后重新启动firefox：&lt;/p&gt;
&lt;p&gt;好了，现在我们终于能访问久违了的推特。&lt;/p&gt;
&lt;p&gt;7，高级：让firefox自动选择代理服务器（这节不是必须的，可以不看）：&lt;/p&gt;
&lt;p&gt;使用ssh是占用我们vps的流量的，如果你访问完推特又访问新浪微博、百度，访问国内网站的时候会很慢，还占用了流量，firefox的AutoProxy插件就是解决这个问题的。&lt;/p&gt;
&lt;p&gt;AutoProxy会维护一个不能正常访问的网站列表，一旦用户访问列表中的网站，就自动调用代理服务器，而访问不在列表上的网站时，就不会使用代理服务器。&lt;/p&gt;</description></item></channel></rss>