12 comments

  • chasil1 hour ago
    I have a few observations about this article.<p>Generally, try not to use SCP. It has been a crufty old program from the Berkeley R-Utilities, but newer OpenSSH releases have rewritten it to use the sftp-server server instead. There will be wildly different behavior between these implementations.<p>The backend SCP changes are documented here:<p><a href="https:&#x2F;&#x2F;lwn.net&#x2F;Articles&#x2F;835962&#x2F;" rel="nofollow">https:&#x2F;&#x2F;lwn.net&#x2F;Articles&#x2F;835962&#x2F;</a><p>If you need something that SFTP cannot do, then use tar on both sides.<p>PuTTY has implemented their pscp to prefer the sftp-server for many years, in a long prediction of the eventual abandonment. Their pscp implementation is a better drop-in replacement than the OpenSSH solutions.<p>The allure of SCP is retry on failure, which is somewhat more difficult with SFTP:<p><pre><code> until scp source.txt user@target:dir&#x2F; do echo target down; sleep 300 done </code></pre> Converting that to pscp is much easier than SFTP.<p>I also have an older rhel5 system where I am running tinysshd to use better SSH crypto. Due to upgrades, NFS is now squashing everything to nobody, so I had to disable precisely these checks to let users login with their authorized_keys. I can post the code if anybody is curious.
    • mistrial91 hour ago
      you sound so wise and produce excellent reference, but in the next breath you show NFS in use?<p>signed -confused
  • tracker131 minutes ago
    I accidentally nuked my hosted server&#x27;s network stack with a config error... my bigger mistake was generating a massive random password for the root account... the remote terminal management console didn&#x27;t support pasting and the default config only gave you like 30s to login.... not fun at all.<p>Script all the things. double-check your scripts... always be backing up.
  • procaryote1 hour ago
    This is a useful tip!<p>but also... who has a dir with 777 permissions? Is that something people do nowadays?
    • easterncalculus53 minutes ago
      My guess would be mounting an NTFS partition - with ntfs-3g it will load everything as 777 just by default, since it can’t translate the permissions.
    • chasil1 hour ago
      Well, everybody has 1777 as &#x2F;tmp (with the sticky bit).<p><pre><code> $ ll -d &#x2F;tmp drwxrwxrwt. 20 root root 4096 Mar 3 12:19 &#x2F;tmp $ mkdir mytmp $ chmod 1777 mytmp $ ll -d mytmp drwxrwxrwt. 1 luser lgroup 0 Mar 3 12:19 mytmp</code></pre>
  • zahlman3 days ago
    I assume using `.&#x2F;*` rather than `.` in the `scp` command would have worked around the issue?
    • malicka1 hour ago
      Yes, since it would’ve copied the globbed files, rather than the current directory itself.
  • MomsAVoxell13 minutes ago
    Done stupid stuff like this enough times that I just use tar, and <i>also</i> make a sandbox directory to receive it, to double-check whats going to happen, before un—tar’ing it again into the destination intended and&#x2F;or do a manual move.<p>Too many burned fingers to not do this little dance almost every other time.<p>Actually, I lied, I just use rsync like an insane person.
  • impure1 hour ago
    Ah, file permissions. My old friend. Good thing this happened on a &#x27;local&#x27; server and not a remote VPS.
  • sowbug2 hours ago
    Related: In my Bash logout script I have a chmod that fixes authorized_keys. It won&#x27;t help with scp because that&#x27;s non-interactive, but it has helped the other 999 times I&#x27;ve forgotten to clean up the mess I made during an ssh session.
  • TZubiri1 hour ago
    Getting locked out of a server must be a cannonical experienc in the sysadmin journey, like checking the logs to see you are being attacked as soon as your online, or trying to build your own linux from scratch without bloat.
  • crest2 hours ago
    It&#x27;s nice to see people sharing their mistakes too.
  • rhier152 minutes ago
    [dead]
  • roelschroeven2 hours ago
    tl;dr: I you scp -r to your homedir, expect scp to copy not just files and directories but their permissions as well (which I think isn&#x27;t all that surprising).
    • ranger_danger2 hours ago
      It&#x27;s not supposed to do that unless it&#x27;s newly creating the destination, or you supplied the -p flag to preserve permissions... that&#x27;s what the entire issue is about; it&#x27;s a bug that was fixed in 10.3.
      • Calzifer1 hour ago
        I wouldn&#x27;t even expect it on newly created stuff without the -p flag. Normal cp doesn&#x27;t do it.
  • binaryturtle3 hours ago
    When I load the site in my (slightly older) Firefox I just get some random junk and gibberish (markov chain generated nonsense?)<p>&lt;bleep&gt; that nonsense!
    • theblazehen1 hour ago
      I suspect you&#x27;re hitting the page where they&#x27;re running <a href="https:&#x2F;&#x2F;iocaine.madhouse-project.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;iocaine.madhouse-project.org&#x2F;</a><p>Perhaps you got bot flagged or something