Slashdot Mirror


Getting the Most Out of SSH

jfruh writes "If you have to administer a *nix computer remotely, you hopefully ditched Telnet for SSH years ago. But you might not know that this tool does a lot more than offer you a secured command line. Here are some tips and tricks that'll help you do everything from detect man-in-the-middle attacks (how are you supposed to know if you should accept a new hosts public key, anyway?) to evading restrictions on Web surfing." What are your own favorite tricks for using SSH?

284 comments

  1. InfoWorld at it again by MasterMan · · Score: 3, Informative

    Seriously, anyone who uses SSH knows about things like proxying your connection via the connection and X11 forwarding. This is nothing new. This is just InfoWorld getting backlinks and traffic from Slashdot once again. Hell, I knew about these things when I was 16 and so did every other guy I knew who ever had used SSH.

    1. Re:InfoWorld at it again by MasterMan · · Score: 1

      The best thing is that there isn't really even "16 tricks". Most of them are about the same things, like the first randomart images. And then, we are taught how to use screen, like it somehow matters that it is over remote connection!

    2. Re:InfoWorld at it again by buchner.johannes · · Score: 5, Interesting

      My favorite trick is
      1) have a server on the internet, let someone ssh -R their port 22 there
      2) connect to that server too with ssh -L putting their port 22 on the local port 8022
      3) Now you have a peer-to-peer ssh (with -Y), and you can run graphical applications remotely.

      --
      NB: The message above might reflect my opinion right now, but not necessarily tomorrow or next year.
    3. Re:InfoWorld at it again by Anrego · · Score: 2

      Indeed. And that was the closest thing to an "ultimate hack". Everything else was basic intro to Linux type stuff.

      That and the randomart stuff was very poorly explained. Personally I think that feature is pointless anyway. If you are in a position where you feel you might actually get a MiM attack.. copy the key onto a USB stick.

    4. Re:InfoWorld at it again by Dwedit · · Score: 3, Informative

      It does matter though. Didn't use screen? Lost a connection? Your processes are terminated. Linux sucks in that regard, you need to know about the hangup "feature" that immediately kills your processes when the terminal dies.

    5. Re:InfoWorld at it again by hcs_$reboot · · Score: 1

      The 16 tricks are pretty high level, while some people still don't know that 'PermitRootLogin' in sshd_config is set to 'yes' by default...

      --
      Slashdot, fix the reply notifications... You won't get away with it...
    6. Re:InfoWorld at it again by tangent3 · · Score: 4, Informative

      That's what nohup is for

    7. Re:InfoWorld at it again by jellomizer · · Score: 3, Insightful

      Well to be fair not everyone had SSH when they were 16 years old...

      I was 16 once, and I would try to figure out how to do all the cool new trick that my new systems has... As we get older we get in a groove (mostly due to the fact that we are paid to do a particular job, and if we spend too much time finding something new and cool would prevent us from getting things done by are estimated time)

      And after 8+ hour of work when we get home the last thing we want to do is more work.

      --
      If something is so important that you feel the need to post it on the internet... It probably isn't that important.
    8. Re:InfoWorld at it again by GameboyRMH · · Score: 5, Informative

      Yep I shoulda looked before I clicked...nothing non-obvious here folks, move along.

      Here's an actual handy tip: You can make your RSA keyfiles also act as shellscripts for the connection, so you only need to carry 1 file to open the connection from any *nix machine.

      To do it, just prefix your keyfile (say it's called ssh_my_server) like this:

      #! /bin/sh
      ssh user@hostname -i ssh_my_server
      exit

      ----------BEGIN RSA PRIVATE KEY--------
      (key goes here, use 4096-bit key for extra l33tness)

      Make the file executable and now you can open the connection just by cd'ing to it and running it.

      --
      "When information is power, privacy is freedom" - Jah-Wren Ryel
    9. Re:InfoWorld at it again by syzler · · Score: 4, Informative

      I generally prefer the apps on my desktop rather than the remote apps. "ssh -D 8080 " will start a SOCKS4/SOCKS5 server running on your local port 8080 and proxy the connections out the remote side. This allows all of your SOCKS enabled applications on your local workstation to make use of the tunnel without having to setup a one to one port mapping.

    10. Re:InfoWorld at it again by MasterMan · · Score: 5, Informative

      It does matter though. Didn't use screen? Lost a connection? Your processes are terminated. Linux sucks in that regard, you need to know about the hangup "feature" that immediately kills your processes when the terminal dies.

      Yes, but this isn't even explained in the article!

    11. Re:InfoWorld at it again by Anonymous Coward · · Score: 0

      That depends on how the user answered the question during the install so it could still be yes, although you are correct that the default is no.

    12. Re:InfoWorld at it again by Albanach · · Score: 4, Insightful

      Hell, I knew about these things when I was 16 and so did every other guy I knew who ever had used SSH.

      To be fair, I'm sure there are sixteen year olds reading /.

      I don't expect every article to be useful to me. Not sure why you would expect that.

      I haven't read the article - I think I'm familar enough myself with ssh - but as long as the info is accurate, I'd image it's a useful tutorial for folk getting into Linux.

    13. Re:InfoWorld at it again by icebraining · · Score: 4, Informative

      Using sshuttle, the applications don't even need to support SOCKS; it proxies all traffic over SSH.

    14. Re:InfoWorld at it again by nschubach · · Score: 5, Interesting

      In my opinion, I think it might be a better idea to kill the errant job if the controller/user gets disconnected than to continue with a job that may need a followup command that may never come, possibly leaving the server in an unusable state. So you have a choice of trusting the user or having the user say explicitly, "trust me, this is what I want to happen (screen/nohup)... even if I get disconnected."

      --
      Every time I start to have faith in humanity, I ruin it by driving to work between 7 and 8 am.
    15. Re:InfoWorld at it again by dingen · · Score: 1

      Which distro comes with an enabled root user these days?

      --
      Pretty good is actually pretty bad.
    16. Re:InfoWorld at it again by marcosdumay · · Score: 2, Informative

      The GP is certainly asking for a default screen session evey time he does SSH, emulating what he gets on Windows.

      Oh, well, most people prefer the option of choosing what session to use when they connect, thus things don't get linked the way he wants, but it is easy enough to set ssh to execute "screen -r" when one connects... The GP needs only to RTFM (the first line of it).

    17. Re:InfoWorld at it again by marcosdumay · · Score: 1

      Not on Debian.

    18. Re:InfoWorld at it again by Skuld-Chan · · Score: 1

      I know about a lot of stuff like this too, but when I was 16 the internet didn't really exist the way it is today. I remember using telnet and rsh for everything for example.

    19. Re:InfoWorld at it again by allo · · Score: 1

      [exec] screen -r on the remote shell or ssh screen -r ... mostly the same stuff, and already covered later by "directly running commands via ssh".

      And to easily edit known_hosts there is an easy vim trick: vim .ssh/known_hosts +line_no (opens vim, jumps to line #line_no)

    20. Re:InfoWorld at it again by hcs_$reboot · · Score: 4, Informative

      To be honest I don't know, but these man pages show
      PermitRootLogin
      Specifies whether root can log in using ssh(1). The argument must be "yes", "without-password", "forced-commands-only" or "no". The default is "yes".

      --
      Slashdot, fix the reply notifications... You won't get away with it...
    21. Re:InfoWorld at it again by Anrego · · Score: 1

      Wow. Thanks!

      And yeah.. that was more useful and more worthy of being called an "ultimate hack" then everything in this lame article combined.

    22. Re:InfoWorld at it again by Anrego · · Score: 2

      Problem is the article is all over the place. It lists basic "intro to linux 101" stuff right next to "security paranoid enterprise server admin" stuff (which is does a very bad job of explaining anyway).

      There are plenty of good "intro to SSH" articles and plenty of good "advanced SSH tricks" articles out there. This is just trash.

    23. Re:InfoWorld at it again by Anonymous Coward · · Score: 0

      Perhaps anyone who uses SSH regularly with a need for a multitude of features. I have *used* SSH and hardly consider myself even a novice. Half the information I found to be intestering and potentially useful. The other half was mostly over my head.

      The article may be useless to you, but I can guarantee your post is a worthless piece of crap to everyone. Informative how? Seriously, anyone who reads Slashdot knows about things like backtraffic and slashvertisements. This is nothing new.

      And guess what, the people reading this post actually read Slashdot whereas the people reading Slashdot may not be adept at or familiar with SSH (but are likely occasional shell users and fans of alternate OS/software).

      To pre-empt any reply you may have and I won't read: fuck off and die.

    24. Re:InfoWorld at it again by nine-times · · Score: 1

      Well good for you. You're a 1337 h4x0rz, I guess. There are still some people in the world who are just getting their feet wet.

    25. Re:InfoWorld at it again by Sancho · · Score: 2

      On the sshd_config which ships with FreeBSD has this disabled.

    26. Re:InfoWorld at it again by Anonymous Coward · · Score: 1

      If you don't spend time learning cool, new things (IOW other stuff, not always cool or even new), you may one day find yourself without 8+ hours of work. Never, ever feel secure in your job. Eventually there'll be layoffs, or a purchase, or a merger, and even if you're the best engineer there, you may still get sacked. And when you do, you'l realize that the world passed you by. And in the tech universe, that can happen in a matter of months, not years or decades.

    27. Re:InfoWorld at it again by miknix · · Score: 5, Funny

      What about unlimited encrypted storage?

      you need TCP forwarding enabled in your sshd_config, then

      ssh -L localhost:2222:localhost:2222 localhost
      $ echo "data you wanna save" | nc localhost 2222

      # or if you want to backup your hdd, try:
      $ cat /dev/sda1 | nc localhost 2222

      # the data will be forwarded forever in the loopback link at no cost until you read it back:
      $ nc localhost 2222 > hdd-backup.bin

      # profit!

    28. Re:InfoWorld at it again by dc29A · · Score: 1

      Ubuntu has a root user.

    29. Re:InfoWorld at it again by Anonymous Coward · · Score: 0

      I'm not sure why exactly you'd want to do that.

    30. Re:InfoWorld at it again by hawkinspeter · · Score: 1

      However, it doesn't have a valid password for root, so you won't be able to login remotely as root unless you've set up key authentication.

      --
      You're a temporary arrangement of matter sliding towards oblivion in a cold, uncaring universe
    31. Re:InfoWorld at it again by buglista · · Score: 1

      That's dated September 1999. Anything current and sane has root login turned off by default.

    32. Re:InfoWorld at it again by CBravo · · Score: 1

      and you can, for the sake of being able to rename your keyfile, replace the word ssh_my_server with ${0}. .

      --
      nosig today
    33. Re:InfoWorld at it again by dylan_- · · Score: 4, Informative

      My mistake, then. I'd heard they'd gone the same route as OS X (incorrectly, it appears). Apologies to all.

      Nope, you heard correctly. The bit you're mistaken about is that OS X also has a root user. In both cases, the account is "locked" (no matchable password is set). Set a password for the root user and it works as normal.

      --
      Igor Presnyakov stole my hat
    34. Re:InfoWorld at it again by Anonymous Coward · · Score: 0

      Tuh-rash, he says! Couldn't give it away with a quarter in his opinion.

    35. Re:InfoWorld at it again by Anonymous Coward · · Score: 0

      OS X still has a root user:

      http://support.apple.com/kb/HT1528

      On Ubuntu the root user is locked by default:

      https://help.ubuntu.com/community/RootSudo

    36. Re:InfoWorld at it again by Anonymous Coward · · Score: 0

      It's really cool how everyone knows all the same things that you do.

    37. Re:InfoWorld at it again by Anonymous Coward · · Score: 0

      you probably are still waiting to try your first beer and cigarette.

      and you might as well forget about ever getting laid.

    38. Re:InfoWorld at it again by strikethree · · Score: 1

      Or... the computer could keep the jobs going and allow you to reconnect to them when you are finally able to reconnect to the computer... I am unsure why that is not a part of job control already. Unix sure can be weird sometimes.

      --
      "Someone needs to talk to the tree of liberty about its ghoulish drinking problem." by ohnocitizen
    39. Re:InfoWorld at it again by GameboyRMH · · Score: 1

      I was just wondering if there was a way to self-reference the filename, thanks.

      --
      "When information is power, privacy is freedom" - Jah-Wren Ryel
    40. Re:InfoWorld at it again by tqk · · Score: 1

      Just curious; I haven't tried it. Does it then ask you for your passphrase?

      So, if I wander past your workstation and see an unsecured shell prompt, can I just do:

      find $HOME -type f -exec grep ssh {} \;

      then run that script, and I'm in?

      --
      "Tongue tied and twisted, just an Earth bound misfit ..." -- Pink Floyd.
    41. Re:InfoWorld at it again by Anonymous Coward · · Score: 0

      reverse tunnels are great. Do you know how to create one so the traffic is only accessible from that actual ssh session? meaning, I don't want 8022 to be available to anyone else on the host.

    42. Re:InfoWorld at it again by GameboyRMH · · Score: 1

      It will ask for your passphrase if the keyfile is passphrased. If it's not, then it won't, and indeed it would be more dangerous if lost or stolen than a keyfile alone.

      --
      "When information is power, privacy is freedom" - Jah-Wren Ryel
    43. Re:InfoWorld at it again by Zeromous · · Score: 1

      Having seen Primer, this backup technique is more than a little disconcerting.

      --
      ---Up Up Down Down Left Right Left Right B A START
    44. Re:InfoWorld at it again by kangsterizer · · Score: 1

      and thats why /. readers arestill better than the likes of HN (which has TFA once a week as top story)

      heck some even just read man and that's that (holy cow all the secrets are clearly explained when you RTFM!)

    45. Re:InfoWorld at it again by roman_mir · · Score: 1

      Well, with iptables for example you can do

      iptables -I INPUT -p tcp -m tcp -s xxx.xxx.xxx.xxx --dport 8022 -j ACCEPT
      iptables -I INPUT -p tcp -m tcp -s 0.0.0.0/0 --dport 8022 -j DROP

      with pf:

      block in all
      block out all ...
      pass in log inet proto tcp from xxx.xxx.xxx.xxx to $ext_if port ssh
      pass out log inet proto tcp from any to $ext_if port ssh

      or something similar depending on the versions of the tools.

    46. Re:InfoWorld at it again by Wolfrider · · Score: 1

      --Actually, if you forget nohup, you can still use " disown "... FYI ;-)

      --
      .
      == WolfriderV6 == I'm willing to admit that *I just might* be wrong... Are you??
    47. Re:InfoWorld at it again by doom · · Score: 1

      Hell, I knew about these things when I was 16 and so did every other guy I knew who ever had used SSH.

      Your circle of acquaintances is not wide. When I was 16 ssh didn't exist yet.

      Don't object to stating the obvious if it's correct and useful.

    48. Re:InfoWorld at it again by Anonymous Coward · · Score: 0

      I knew about these things when I was 16 and so did every other guy I knew who ever had used SSH.

      When was that, last month?

    49. Re:InfoWorld at it again by Anonymous Coward · · Score: 0

      How is that blocking anyone else on the host?

      It looks like it blocks all other hosts, but that's hardly the same thing.

    50. Re:InfoWorld at it again by mattventura · · Score: 1

      If you only need to do something basic like delete a specific line number, then there's an even easier way: just use sed. If you know you want to delete line 10, then just do "sed -i 10d .ssh/known_hosts"

    51. Re:InfoWorld at it again by kiore · · Score: 1

      SSH didn't even exist when I was 16 (nor 32, for that matter) but I have used it most days since the late 1990s.

      Keep your mind open and new tricks and tools will find their way in then use the maturity gained by experience to filter out the dross and keep the ones that are useful to you.

    52. Re:InfoWorld at it again by deek · · Score: 1

      You are correct. Try using the following instead:

      iptables -I OUTPUT -p tcp -d localhost --dport 8022 -m owner ! --uuid-owner me -j REJECT

      Obviously change the owner name to whatever login name you use.

    53. Re:InfoWorld at it again by DarwinSurvivor · · Score: 2

      tsocks can be used to add SOCKS support to anything.

    54. Re:InfoWorld at it again by DarwinSurvivor · · Score: 1

      Set up ssh keys (takes 10 seconds) and never worry about such things again.

    55. Re:InfoWorld at it again by Anonymous Coward · · Score: 0

      Pretty cool, but wont work for executing commands or scp. you're better off using ssh_config to set the keyfile, hostname, user and server alias. then scp works great too.

    56. Re:InfoWorld at it again by Anonymous Coward · · Score: 0

      Eventually there'll be layoffs, or a purchase, or a merger, and even if you're the best engineer there, you may still get sacked.

      I work for the Department of Defence in Australia as an Engineer. No-one here gets sacked or laid off unless they well and truly fuck up (mainly if they're looking at porn on Commonwealth machines). The lack of stress from dealing with corporate politics that put everyone's job in jeopardy is a great relief.

    57. Re:InfoWorld at it again by enoz · · Score: 1

      The full horror of the GP's post was only revealed to me after you mentioned Primer.

    58. Re:InfoWorld at it again by Anonymous Coward · · Score: 0

      Seriously, anyone who uses SSH knows about things like proxying your connection via the connection and X11 forwarding. This is nothing new. This is just InfoWorld getting backlinks and traffic from Slashdot once again. Hell, I knew about these things when I was 16 and so did every other guy I knew who ever had used SSH.

      Seriously, we know that you know. There are 16 yrs old who are still learning unless you think you were the last 16 yr old.
      If you have nothing constructive just stfu.

    59. Re:InfoWorld at it again by Zeromous · · Score: 1

      I personally thought it would be worth more Karma.

      --
      ---Up Up Down Down Left Right Left Right B A START
    60. Re:InfoWorld at it again by Electricity+Likes+Me · · Score: 1

      Yeah but in that case you can't actually get back to the console session, which is principally what screen is good for.

    61. Re:InfoWorld at it again by Anonymous Coward · · Score: 0

      I have all the storage in the world and it's not readable by anyone - mv * /dev/null

    62. Re:InfoWorld at it again by terbeaux · · Score: 1

      Maybe you and the author of screen have something in common. "Toss this in your ~/.bash_profile so that you never have that "oh crap" moment where you wanted to run something in screen and didn't." http://www.commandlinefu.com/commands/view/2035/set-your-profile-so-that-you-resume-or-start-a-screen-session-on-login

    63. Re:InfoWorld at it again by geminidomino · · Score: 1

      Never seen Primer, but my mind went right to the ST:TNG episode "Relics"...

    64. Re:InfoWorld at it again by Anonymous Coward · · Score: 0

      Not necessarily - some people use ssh because their sysadmin said he turned telnet off. If you're busy doing things which need to be done in a business environment but are not the sysadmin it could be useful to know some things pointed out in the article.

      Sure, it may be of no use to you or many others here and anyone could read the man page or whatever, but I find such things useful.

    65. Re:InfoWorld at it again by Elrond,+Duke+of+URL · · Score: 3, Informative

      Even better is the screen/tmux wrapper called byobu (https://launchpad.net/byobu). It puts a nice face on screen (and now also tmux) and greatly simplifies basic usage. It also has a large selection of status notifications that can be displayed on the bottom one or two lines of your terminal which show things like the current screens, load, time, etc.

      The default key mapping uses the function keys for the most common commands. For example, F2 for a new window, F3/F4 for previous/next window, and so on. It provides a wrapper around the session handling as well, so that, in general, you can almost always just run "byobu" and get your session back or start a new one if there is none existing. And if it finds that you have more than one session running, it will ask you which one to connect to.

      In the configuration menu (F9), the last item allows you to toggle auto-launching at login. Select it and it will add a line to the end of your shell's profile file to start byobu when you login.

      Development has been proceeding at a very rapid pace over the past year and the feature set it quite nice. Recently, the default backend was switched from screen to tmux, but because byobu is a wrapper on top of those programs, I didn't need to learn a new set of keys... though it did help to read up on tmux to see what it could/couldn't do as compared to screen. For the most part, the change was transparent, though tmux only does one status line at the bottom of the terminal versus the two that you had with screen. One of the nicest changes is that tmux can determine what command you are executing in a window and it shows this in place of a window's generic title in the status line. Screen could do this too, but you had to jump though some hoops, change your shell prompt, and it didn't always work.

      Anyway, with the additions byobu brings to screen/tmux, I always have it running which has the added benefit that in the (these days, not very likely) event of SSH dropping my connection, nothing is lost. I usually use it in local terminals too, so if X or my terminal ever crashes for some odd reason, I'm saved there, too.

      --
      Elrond, Duke of URL
      "This is the most fun I've had without being drenched in the blood of my enemies!"-Sam&Max
    66. Re:InfoWorld at it again by Anonymous Coward · · Score: 0

      Your ssh command syntax is incorrect. On a weekly basis I lecture younger *IX users about this behaviour: do not get in the habit of simply appending flags to the end of the command string. The behaviour of the argv[] parser is COMPLETELY dependent upon the underlying software; not everyone uses getopt(), and even programs which do sometimes have one-offs where exceptions are made.

      The official syntax allowed is: ssh [flags/options] [host or user@host]

      If you'd like, I can show you lots of UNIX software which will barf horribly if you do things like "program blah -x -y -z" because "blah" is expected, always, to be the *last argument* on the command-line.

      Break this habit ASAP.

    67. Re:InfoWorld at it again by semi-extrinsic · · Score: 4, Informative
      Personal favourite: If you have machines on a LAN that are only exposed to that LAN, but there is one "gateway" machine that you can ssh to from the internet: use ProxyCommand, and you can ssh "directly" to the machines on the LAN even from the internet! Put the following in your .ssh/config:

      Host gate1
      Hostname 128.141.81.163
      User joe

      Host local12
      Hostname 192.168.1.12
      User joe
      ProxyCommand ssh -e none gate1 exec netcat -w 5 %h %p

      You can now ssh to "local12" just by typing "ssh local12", whether you are on the LAN or not.

      --
      for i in `facebook friends "=bday" 2>/dev/null | cut -d " " -f 3-`; do facebook wallpost $i "Happy birthday!"; done
    68. Re:InfoWorld at it again by Anonymous Coward · · Score: 0

      You sir, have made me glad that my profession is actually in a kitchen. Nothing seems more stifling to a nerd than working in a nerdy field of business. I'll take my low pay and completely non-technical employment to keep work from interfering with my computer interests....and my boss will even benefit, because I still do things like alert them to MS-12-020...

    69. Re:InfoWorld at it again by Anonymous Coward · · Score: 0

      Speak for yourself, wage slave.

      And this is modded 5 insightful; slashdot is a tabloid for the retarded.

    70. Re:InfoWorld at it again by cr_nucleus · · Score: 1

      Word of advice for would be users of this technique, please generate a specific private key to carry around.
      It will be less problematic the day you lose your thumb drive.

    71. Re:InfoWorld at it again by Arrepiadd · · Score: 1

      Maybe a bit late, but OpenSUSE as of 11.4 still had "PermitRootLogin yes" by default. Haven't checked for later versions...

    72. Re:InfoWorld at it again by Anonymous Coward · · Score: 0

      chck again there buddy

      always has been as long as i been using it >5 years or so....

    73. Re:InfoWorld at it again by Anonymous Coward · · Score: 0

      Hell, I knew about these things when I was 16 and so did every other guy I knew who ever had used SSH.

      You insensitive clod. Some of us were already in our thirties before we encountered any version of *nix much less the ever useful SSH client-server. I bet you do not remember dial-up MODEMs before 28.8 kbps. Get off my lawn! ;)

    74. Re:InfoWorld at it again by Miqlo · · Score: 1

      Haven't commented here for a long time, but to this I must reply to point out something that is not immediately obvious; with SSH X11 forwarding you had better be sure that you trust whoever has root access in the other end because they can quite easily fully hijack your X-session and gain potentially unlimited access to your system.

      Miq

    75. Re:InfoWorld at it again by Anonymous Coward · · Score: 0

      That's what should be happening during those 8+ hours at work. The other 8 hours should be spent doing something different with your life, lest you become a single-minded idiot.

    76. Re:InfoWorld at it again by Lord+Apathy · · Score: 1

      --Actually, if you forget nohup, you can still use " disown "... FYI ;-)

      Hello new command. Thank you for showing me this one. Don't just love those moments when you learn something new like this and just say "sweet?" This is one of those moments.

      --

      Supporting World Peace Through Nuclear Pacification

    77. Re:InfoWorld at it again by Lord+Apathy · · Score: 1

      Maybe a bit late, but OpenSUSE as of 11.4 still had "PermitRootLogin yes" by default. Haven't checked for later versions...

      I just checked with OpenSuse 12.1. It has "PermitRootLogin yes" but its commented out. I'm assuming that is the same as "PermitRootLogin no" but not going to take any chances. I uncommented it and changed the yes to no anyway.

      --

      Supporting World Peace Through Nuclear Pacification

    78. Re:InfoWorld at it again by stridebird · · Score: 1

      Quite right. I was certainly over 16 when I first used SSH. In fact, I thought I was late to the party, but I have just read the wikipedia page on SSH and there it is: first released in 1995. So basically, it's only 17 year olds that can say this. Like the GP.

    79. Re:InfoWorld at it again by Anonymous Coward · · Score: 0

      Or `basename $0`

    80. Re:InfoWorld at it again by Anonymous Coward · · Score: 0

      screen? Are people still using that after tmux(1) appeared?

    81. Re:InfoWorld at it again by jellomizer · · Score: 1

      OK, the official title for this phenomena is "Opportunity Costs".

      When you are 16 there are less risks in life so your "Opportunity Costs" are more level. You choose to learn SSH vs. Hanging out with your friends when you are 16 doesn't have much weight, as you can do both, or the risk of not doing one for the other doesn't cause a major (short term) problem.

      When you are 35, learning SSH vs. Getting your work load done. Does give you a different weights for your Opportunity, SSH you may be able to Google later if you need to master it, but you need to get your work done now or you will not get paid. There are weights and more severe consequences for choosing one option or the other.

      If you have to buy your own food, shelter and a family that needs food and shelter too. You need to balance your time on knowing what you should learn and what you need to do.

      --
      If something is so important that you feel the need to post it on the internet... It probably isn't that important.
    82. Re:InfoWorld at it again by Arrepiadd · · Score: 1

      It's the same as in 11.4.
      Whatever is commented out keeps the default behavior. As already mentioned in this thread, the default is allowing root logins. Your change to "No" prevents root access (provided you restarted the SSH daemon). Of course you can use "without-password" to allow ssh-key based access to root, if you still have a need for it.

    83. Re:InfoWorld at it again by allo · · Score: 1

      yeah, but then i can copy&paste the suggested ssh-keygen commandline as well. often i want to see the actual line and maybe the next (which is often the same hostkey but this time for the ip and not for the hostname).

    84. Re:InfoWorld at it again by thereitis · · Score: 1
      Nice tip. You can improve on it like this:

      #! /bin/sh
      ssh user@hostname -i $0
      exit

      The $0 (dollar-zero) expands to the name of your script (including path) so you don't need to be in the same directory. Now add $HOME/.ssh to your PATH and you can run it from anywhere.

  2. Hopefully? by Enry · · Score: 5, Insightful

    If you're still using telnet to administer anything that offers SSH, you should probably choose another field to work in.

    1. Re:Hopefully? by hcs_$reboot · · Score: 4, Interesting

      well I occasionally use 'telnet host 25' to test the smtp port

      --
      Slashdot, fix the reply notifications... You won't get away with it...
    2. Re:Hopefully? by buchner.johannes · · Score: 4, Insightful

      Telnet has a protocol. Look at socat and netcat. Socat supports ssl, you can check your smtps server port.

      --
      NB: The message above might reflect my opinion right now, but not necessarily tomorrow or next year.
    3. Re:Hopefully? by vlm · · Score: 1

      Port 110 is trivially tested by hand... port 80 also.

      --
      "Science flies us to the moon. Religion flies us into buildings." - Victor Stenger
    4. Re:Hopefully? by MasterMan · · Score: 0

      You do know that you can use real programming language like C++ for that, right? This way you can automate the process and don't need to read and write every command by hand, and you have the added benefit of having access to variables and higher level programming.

      I used to use telnet for irc, but it got really tiresome to answer to pings.

    5. Re:Hopefully? by CubicleZombie · · Score: 5, Interesting

      I've worked in organizations where, because you can tunnel over SSH, it was banned and blocked over the network. Everything had to be done with Telnet instead. I'm not joking. That is probably what started my loathing of net admins.

      --
      :wq
    6. Re:Hopefully? by hcs_$reboot · · Score: 4, Insightful

      So, when I want to check if the port 25 is not blocked (firewall at ISP...) and is opened, instead of a simple 'telnet host 25' followed by ^D or ^C, I should write a C++ (may I use C for that, please?) program that does the same thing? You do know that some people already wrote some commands for that, right?

      --
      Slashdot, fix the reply notifications... You won't get away with it...
    7. Re:Hopefully? by Junta · · Score: 3, Insightful

      When I see someone testing port 25 or 80, it's usually nothing more than a liveness test. Not worth the overhead of writing a program to open a socket and read and write data. perl/python is a tad more accessible, but still for a once in a blue moon use is generally more trouble than it's worth.

      --
      XML is like violence. If it doesn't solve the problem, use more.
    8. Re:Hopefully? by Anonymous Coward · · Score: 0

      We have some old boxes here that use rsh / rlogin.

      Ancient system with a tonne of scripts that rsh into this and that to do whatever the hell it is they do. It's on a lan though!

      We're working on it ;p

    9. Re:Hopefully? by lcam · · Score: 2

      There may be reasons to use telnet over SSH. Challenge the assumption that it's always better to encrypt communications rather then let someone listen in.

      That being said, your presumption is normally right; ISP administrators who block SSH and only allow file transfer by FTP fall into the same category. They should be fired.

    10. Re:Hopefully? by Anonymous Coward · · Score: 0

      I could spend 3 seconds using telnet from an already open shell window, or I can spend the afternoon automating a process I'm going to do exactly once.

      I've worked with many of idiots who are just like you, you're so efficient you cost yourself and others massive amounts of time. You're like the guy who invents a space pen instead of just using a bloody pencil.

    11. Re:Hopefully? by Anonymous Coward · · Score: 2, Funny

      MasterMan (2603851) - You do know that you can use real programming language like C++ for that, right?

      C++ programmers are truly masters of the universe. I salute you sir for taking hours and object oriented wizardry to do what most programmers would do in 5 mins with a short script.

    12. Re:Hopefully? by slimjim8094 · · Score: 0

      You should use netcat or socat, since those are designed to allow you to fire text at a remote port and display the result. Telnet isn't, it only works "by accident" because the protocol is similar enough to plain text to work sometimes.

      --
      I have developed a truly marvelous proof of this comment, which this signature is too narrow to contain.
    13. Re:Hopefully? by Darinbob · · Score: 1

      Ha, I'm still using rlogin!

    14. Re:Hopefully? by unixisc · · Score: 1

      In college, I used to use that - rsh or rlogin. That was for accessing other hosts on campus, though.

    15. Re:Hopefully? by Galactic+Dominator · · Score: 5, Informative

      Telnet isn't, it only works "by accident" because the protocol is similar enough to plain text to work sometimes.

      Bullshit. It was designed that way. And I can prove it, unlike your assertion.

      http://tools.ietf.org/html/rfc15

      --
      brandelf -t FreeBSD /brain
    16. Re:Hopefully? by kwark · · Score: 4, Informative

      smtps was deprecated years ago (not that I agree). You should use:
      openssl s_client -starttls smtp -connect host:(25|587)
      Something socat doesn't appear to support (that's a first).

    17. Re:Hopefully? by bzipitidoo · · Score: 3, Funny

      And in 2002, when I was contracting for the government, I needed some data that was stored on a government server. They set up a user account for me and rather than email the password to me, called to tell it to me over the phone, because they felt that was more secure than email.

      The joke was that I was to connect via telnet. They didn't have ssh on that server. They didn't even have some kind of secure telnet that would at least try to encrypt the password. Just plain old telnet, with the password transmitted in the clear.

      --
      Intellectual Property is a monopolistic, selfish, and defective concept. It is "tyranny over the mind of man"
    18. Re:Hopefully? by steveb3210 · · Score: 2

      Telnet is wide open to a MITM attack - besides just sniffing the password, suppose you have a shell open - then a MITM hijacking your TCP session could write an arbitrary rlogin file.

      My professor for the computer security class at my college demoed this exact scenario - its not a safe protocol.

    19. Re:Hopefully? by DrgnDancer · · Score: 1

      Wait wha? I mean, I can see blocking it on outgoing ports in the firewall so that you can't tunnel to the outside world, but blocking it internally? Besides, it's trivial to set SSH to listen on port 23 and viola. New tunneling setup.

      --
      I don't need a million points of light, just two points of multi-mode fiber and a 10 Gig-E router.
    20. Re:Hopefully? by jd · · Score: 1

      Hardware encryption is still not widely available and Linux support for it where it does exist isn't great (drivers belong in the kernel, especially drivers you need a high level of security for, but there's so much antipathy towards encryption in the kernel that hardware drivers that merely happen to involve encryption have a very hard time of it).

      As such, SSH is more CPU-intensive (unnecessarily, since a chip could offload the CPU-intensive part of the workload), which means there will be times when SSH is exactly the wrong thing to use. If you're running a Linux box in as close to hard realtime mode as possible, your admin activities must have as light a fingerprint as possible. Yes, ideally hardware encryption would be widely available and widely used, then SSH would be viable in those situations as it would be no more disruptive than any other protocol but provide the security other protocols do not.

      The other case to consider is end-to-end IPSec. What is the point in encrypting traffic twice? The obvious advantage of IPSec is that everything is encrypted, from start to finish, including protocols that don't have any support for encryption. Everything is protected. Ok, not many people run all LAN and extranet connections over p2p IPSec, but they could. What does SSH buy you in those cases? If anything, there's a lot of skepticism in the crypto community towards stacking encryption because that's a much-less scrutinized case and therefore potentially less secure.

      --
      It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
    21. Re:Hopefully? by Enry · · Score: 1

      CPU-based encryption is hard, but there's ports like HPN-SSH that works to keep the connection fast while making sure the authentication still happens in a secure manner.

      My team maintains a system that has a few hundred people logged in at any time, both for interactive connections to our HPC cluster, but also to send data in and out. All of it goes over SSH and the CPUs are rarely breaking a sweat to keep up - it's usually the storage that is lagging.

    22. Re:Hopefully? by sydneyfong · · Score: 5, Informative

      Emails are cached in a lot of intermediate servers and stuff. The logs are routinely backed up. Undelivered emails get forwarded to all sorts of addresses and admins. Even if nobody was maliciously scooping on you, the passwords could land on some random person's hands.

      It *is* more secure over the phone in that sense.

      And it's not a common practice to log down telnet traffic. Anyone who gets your telnet password is probably sniffing maliciously.

      Not to say it's a sane policy to use telnet, but there are these differences in "levels" of safety (both levels are of course very very low). To a security conscious person it may be equivalent, but practically you have less chance a random John Doe will get your password this way. Maybe it matters, don't ask me....

      --
      Don't quote me on this.
    23. Re:Hopefully? by Anonymous Coward · · Score: 0

      Where I worked telnet had been verified, but this newfangled ssh hadn't. About 2002, they may have changed in the last 10 years, but I'm not holding my breath.

    24. Re:Hopefully? by jd · · Score: 1

      Agreed. Those tend to be thinner on the ground, though, which is incredibly annoying. There's also a lot less awareness of acceleration patches and ports, which I suspect has led to a lower adoption level than would have otherwise been the case. I can't remember the last person I talked to who was aware that such software even existed.

      --
      It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
    25. Re:Hopefully? by hawkinspeter · · Score: 1

      More like 5 seconds from the terminal.

      --
      You're a temporary arrangement of matter sliding towards oblivion in a cold, uncaring universe
    26. Re:Hopefully? by hawkinspeter · · Score: 1

      I've never seen a problem with modern CPUs and using SSH (even including transferring files over SSHFS).

      I'd still use SSH over an IPSEC VPN as it provides authentication and prevents a MITM attack. SSH also has the advantage of being ubiquitous - one tool you can use for configuring servers and network equipment in a safe fashion. Now if only Windows supported SSH natively.

      --
      You're a temporary arrangement of matter sliding towards oblivion in a cold, uncaring universe
    27. Re:Hopefully? by Anonymous Coward · · Score: 0

      Heh! I sometimes do work for a large clueless corporate. The legacy application I support has an equally ancient hacked client that can only support SSH version 1 or telnet.

      Fortunately they outsourced their security and system architecture to India who have advised us that SSH V1 is insecure so we may only use telnet.

    28. Re:Hopefully? by cayenne8 · · Score: 1

      I can see blocking it on outgoing ports in the firewall so that you can't tunnel to the outside world

      Yeah, but usually hard for companies to block ALL ports, particularly ones that are popular like, say port 80 or 443...

      It is simple to ssh tunnel through those to try to look like legitimate traffic...just port forward through those...to a home server running squid looking for traffic on those ports...and voila...you're bypassing proxies and firewall rules...

      --
      Light travels faster than sound. This is why some people appear bright until you hear them speak.........
    29. Re:Hopefully? by daid303 · · Score: 1

      Every day.

      Our embedded systems offer SSH. But on a local trusted network telnet is a lot quicker. 50Mhz systems are not that fast with SSL sockets.

    30. Re:Hopefully? by slimjim8094 · · Score: 2

      Not bullshit. A telnet client works best with a telnet server; while you can use it against other servers, it is not ideal. The client interprets certain byte sequences as commands.

      Furthermore, I quote the wiki:

      a Telnet client application may also be used to establish an interactive raw TCP session, and it is commonly believed that such session which does not use the IAC (\377 character, or 255 in decimal) is functionally identical. This is not the case, however, because there are other network virtual terminal (NVT) rules, such as the requirement for a bare carriage return character (CR, ASCII 13) to be followed by a NULL (ASCII 0) character, that distinguish the telnet protocol from raw TCP sessions.

      The wiki lacks citations; I point you to RFC 854 (bottom of page 11).

      Thus, the protocol is not plain text. It is very close, close enough that most things should work fine, but if you actually desire the ability to deal with raw TCP streams, you'd be much better off using a tool designed for it. Such as socat or netcat.

      The protocol was designed to provide remote access similar to a terminal. As such, it includes escape characters and other terminal-control mechanisms. It was not designed to pass text exactly as entered, or display it exactly as sent. Given the common existence of tools that are, it seems like a poor choice to use the inferior one.

      --
      I have developed a truly marvelous proof of this comment, which this signature is too narrow to contain.
    31. Re:Hopefully? by LordLimecat · · Score: 1

      DD-WRT router. Sometimes the webGUI breaks, and SSH may not be available due to problem, but telnet will let you in as an easy password recovery option. You know the username (ALWAYS root when telnetting to DD-WRT), which can make guessing the password easier. Additionally, its gonna be pretty hard to MITM a direct connection from your workstation to the router, and I dont think youd have much luck trying to trick the router into flooding the frame to all ports (is it possible to get the router to drop its own MAC from its ARP table?).

      Of course I would only ever enable it on the LAN.

      There may be other situations, like wanting access between routers on a network that is ACL'd-- I could probably come up with a plausible scenario where not all of the routers are capable of initiating SSH, and security controls do not allow direct connections to all devices. A secure alternative might be having ACLs that only allow SSH tunnels into one of the devices, and from there telnetting to whichever router you want. Only security risk would be if someone had physical access to the links between the routers, and as we all remember physical access is 8/10ths of security.

    32. Re:Hopefully? by Tassach · · Score: 2

      Sounds like a case of throwing out the baby with the bathwater, but in a really secure environment, SSH *is* a huge can of worms, especially when combined with Corkscrew.

      I once worked for a large company with a draconian firewall policy and no remote access solution. SSH connections were forbidden in both directions. So, I came up with a ssh reverse tunnel solution.

      On a box inside the firewall, run this script as a daemon:

      #!/bin/bash
      while true
      do
              nohup ssh -O ProxyCommand=/usr/local/bin/corkscrew \
                        -O TCPKeepAlive=1 \
                      -R 2222:localhost:22 homeuser@homebox
      done

      This creates a persistent, automatically-restarting outbound ssh tunnel, inside a HTTP tunnel. For added obfuscation, I could run sshd on port 443 on homebox.

      Now, (assuming proper corkscrew config), when I'm on homebox I can run:


      ssh -p 2222 workuser@localhost

      By running squid on homebox:3128 and modifying the corkscrewed connection with -L 3128:homebox:3128, When I'm at work I can set my browser's proxy settings to localhost:3218 and browse anonymously, incidentally bypassing their content filter.

      --
      Why is it that the proponents of "one nation under God" are so eager to get rid of "liberty and justice for all"?
    33. Re:Hopefully? by Tassach · · Score: 1

      SSH is more CPU-intensive(unnecessarily, since a chip could offload the CPU-intensive part of the workload), which means there will be times when SSH is exactly the wrong thing to use.

      That may have been valid a decade ago, but unless you're dealing with something that's ridiculously underpowered (like *maybe* a controller on a minimalist embedded system), I can't see SSH adding appreciable overhead. In my experience, even a 200MHz ARM processor, which is found in LOTS of embedded systems, doesn't bog down running SSH.

      If you're running a Linux box in as close to hard realtime mode as possible, your admin activities must have as light a fingerprint as possible.

      In that scenario for remote admin you should ssh to a jumphost that's located close to the RTS, and use some internal firewalling to ensure that ONLY the jumphost has permission to connect to the realtime box. (Which isn't a bad idea anyway even if you're running ssh)

      --
      Why is it that the proponents of "one nation under God" are so eager to get rid of "liberty and justice for all"?
    34. Re:Hopefully? by kasperd · · Score: 1

      You should use netcat or socat, since those are designed to allow you to fire text at a remote port and display the result. Telnet isn't, it only works "by accident" because the protocol is similar enough to plain text to work sometimes.

      That is not exactly correct. If you use netcat newlines are not send in the correct way. The nc command will receive character number 10 from the terminal and write character number 10 on the socket. However text based protocols don't use character number 10 for newlines, they use character number 13 followed by character number 10.

      That means if you use the nc command to connect to a server with just about any text based protocol, you will be sending malformed commands. However many servers will accept what you send anyway and simply do the exact same thing when they see a character number 10 as they would have done if they had seen character number 13 followed by character number 10.

      OTOH using the telnet command to connect to a server with a text based protocol will do the right thing. The telnet command will send the proper 13 followed by 10 sequence when you press enter.

      It is true that what telnet does in this case is nothing like the telnet protocol. As a matter of fact, the telnet protocol is not a text based protocol. The telnet client will recognize the difference because a real telnet server will send some binary data immediately when a connections is established.

      So to talk a text based protocol using the telnet client is a better choice. If you are going to be using a binary protocol, nc is more suitable (but of course then stdin and stdout should of course not be a terminal). One problem that nc still has is that it doesn't properly handle half open connections correctly, not that I think telnet is any better, it is just that when pushing raw data over a TCP socket, nc is my usual choice, and in those cases half open connections matter.

      Speaking of ssh tricks, I wrote this tool a few years back to allow the ssh client to choose from multiple alternative ways to connect to an ssh server.

      --

      Do you care about the security of your wireless mouse?
    35. Re:Hopefully? by karnal · · Score: 1

      Here is a clue though. Any firewall worth it's salt will do protocol inspection and not just blindly let you use a port.

      Now the question is whether the admins set it up that way.

      --
      Karnal
    36. Re:Hopefully? by slimjim8094 · · Score: 1

      Works for me, as they say. But check out this to send a literal CRLF (CTRL+V enter enter)

      --
      I have developed a truly marvelous proof of this comment, which this signature is too narrow to contain.
    37. Re:Hopefully? by kasperd · · Score: 1

      Some servers don't care, and you can get away with just using nc. And as you point out, a few extra keypresses can get nc to send the newline as required by the protocol. But I don't see why that is in any way better than using the telnet command, which will do the right thing by default.

      --

      Do you care about the security of your wireless mouse?
    38. Re:Hopefully? by rubycodez · · Score: 1

      your netcat pumping of an smtp server won't be able to react to varying possible replies as the human brain, it is inferior to telnet for the job. the escape and terminal control characters are of no import since they won't occur.

    39. Re:Hopefully? by Electricity+Likes+Me · · Score: 1

      It's almost criminal the HPN-SSH patches haven't been rolled into mainline SSH yet. On modern LAN's, SSH is incredibly slow at data transfer yet tons of guides out there on the internet (and systems) propose using it for things like disc imaging and the like - where it's completely unsuited.

      The average user ends up with either a disappointing experience, or just turns off encryption / uses no authentication whatsoever.

      The HPN-SSH patches more or less fix all these problems: SSH gets faster, they've added a multi-threaded AES cipher, and the "none" cipher let's you retain secure authentication and HMAC digests without the transfer overhead of encryption (which is incredibly useful when you want to move basically unsecure items like log files, media etc.) but retaining secure log in and authentication.

    40. Re:Hopefully? by Skapare · · Score: 1

      I just use SSH to make my VPN. See the -w option.

      --
      now we need to go OSS in diesel cars
    41. Re:Hopefully? by trastomatic · · Score: 1

      Telnet inside SSH still makes sense. Ie: hosting company, both end customers and hosting company have root access. Customers can do their daily work, but hosting company is responsible for server health. How can one be sure that the server didn't became unresponsive due to some commands issued by the customer? AFAIK, SSH is not replayable, whilst telnet is. So, just tunnel a telnet to localhost inside an SSH session, and log the telnet session in a (safe,encrypted) remote box.

    42. Re:Hopefully? by anarcat · · Score: 1

      i have stopped using telnet when i discovered swaks. It just rocks.

      --
      Semantics is the gravity of abstraction
    43. Re:Hopefully? by goeldi · · Score: 1

      Oh I'm sure you already use ftp, don't you? So where's the difference? telnet -> ssh, ftp -> sftp. get it?

    44. Re:Hopefully? by Enry · · Score: 1

      Anonymous FTP, yes. Authenticated unencrypted FTP I haven't used in well over 10 years.

    45. Re:Hopefully? by Anonymous Coward · · Score: 0

      N e t Fing. C a t. Is that so hard?

  3. SSH Tunnel by slashgrim · · Score: 2
    1. Re:SSH Tunnel by lcam · · Score: 1

      The holy grail of SSH, IMO, is tunneling. No firewall can stop you! (Well they can but they have to move to something more sophisticated then packet inspection and port blocking.)

    2. Re:SSH Tunnel by Ruzty · · Score: 4, Insightful

      Traffic pattern matching over SSL. A web session over an SSL connection looks very different than an ssh tunnel session over SSL, not to mention the length of life of the socket. It's trivial to have the firewall identify the ssh connection over port 443 and disconnect it in the first few seconds of the session based purely on the pattern of the traffic regardless of content.

      --
      The Master (Angelo Rossitto) in Mad Max Beyond Thunderdome, "Not shit, energy!"
    3. Re:SSh tunnel by manoweb · · Score: 2

      But a PPP over SSH gives you a complete VPN, not only a bunch or redirected ports.

    4. Re:SSH Tunnel by lcam · · Score: 1

      Neat. Thanks for your input.

    5. Re:SSh tunnel by Anonymous Coward · · Score: 1

      Oh baby, I want your packet in my tunnel so bad ...

    6. Re:SSH Tunnel by allo · · Score: 1

      no, it could be a http keep alive connection inside the ssl-tunnel. and you do not know the traffic patterns of certain web-apps.
      On the other hand with ssh and screen you can reconnect fast and without noticing, if you need to.

      But you should propably not risk a fight with the admins. either accept or discuss the rule.

    7. Re:SSh tunnel by impaledsunset · · Score: 1

      OpenVPN beats both solutions.

    8. Re:SSh tunnel by Anonymous Coward · · Score: 0

      True, but on systems where pppd is unavailable (permissions or just not there!) then SSH tools are most useful!

      On a side note, I notice activex controls do not honour browser proxy settings, whereas java applets do (HP ILO remote console in mind)

    9. Re:SSh tunnel by wertarbyte · · Score: 2

      plus the problems of layering multiple TCP layers above each other. Also, PPP is not needed anymore: ssh can establish VPN connections using tun devices quite fine ("-w")

      --
      Life is just nature's way of keeping meat fresh.
    10. Re:SSh tunnel by Krneki · · Score: 1

      Yes, but can also be blocked/detected easier then SSH.

      --
      Love many, trust a few, do harm to none.
    11. Re:SSh tunnel by manoweb · · Score: 1

      That problem is more theoretical than practical. Back in the day I was doing videoconferencing H.263/SIP and all that stuff with PPP over SSH and I had no problem at all. And it works when there is a very strict (and stupid) firewall setting that does not allow but port 80 TCP destinations like at my University in the late 90's. Just one open TCP port and you have a full VPN that works well; other VPN systems were not quite as easy to put together.

    12. Re:SSH Tunnel by hawkinspeter · · Score: 2

      I didn't know this was feasible. How would I do that in a Cisco ASA firewall?

      --
      You're a temporary arrangement of matter sliding towards oblivion in a cold, uncaring universe
    13. Re:SSh tunnel by LordLimecat · · Score: 1

      Other than the fact that OpenVPN is SSL, sure.

    14. Re:SSh tunnel by kasperd · · Score: 1

      True, but on systems where pppd is unavailable (permissions or just not there!) then SSH tools are most useful!

      I have on some occasions used PPP over SSH without having pppd available on the server. I used pppd on the client and slirp on the server. The result was usable, though performance of anything trying to layer IP on top of TCP is not going to be great. At some point I switched to running PPP over UDP packets and just used an SSH connection to start the software in each end. I used scp to transfer a key for encrypting the traffic.

      --

      Do you care about the security of your wireless mouse?
    15. Re:SSH Tunnel by Anonymous Coward · · Score: 0

      I didn't know this was feasible. How would I do that in a Cisco ASA firewall?

      Get a PaloAlto firewall and welcome yourself to layer 7 land.

    16. Re:SSH Tunnel by hawkinspeter · · Score: 1

      Can one of those tell the difference between SSH and HTTPS without decrypting if they're using the same ports?

      --
      You're a temporary arrangement of matter sliding towards oblivion in a cold, uncaring universe
    17. Re:SSH Tunnel by Anonymous Coward · · Score: 0

      As hawkinspeter asked:
      How?
      I would really love to know how to block SSH tunnels over SSL without decrypting traffic.
      An ASA would be a good appliance for your example, or a linux firewall.

      Particularly interested in your 'trivial' statement.

    18. Re:SSH Tunnel by OdinOdin_ · · Score: 1

      Not in age of Websockets RFC6455 ]:->

  4. I hope the list of tricks by Anonymous Coward · · Score: 0

    I hope the list of tricks includes skipping the banner ad while trying to look at the page containing the tricks...

    1. Re:I hope the list of tricks by Anonymous Coward · · Score: 0

      Or the twenty web-bugs, trackers, beacons, etc. Also per page. Thank heavens for Ghostery.

    2. Re:I hope the list of tricks by Wee · · Score: 3, Funny

      Thank heavens for Ghostery.

      You misspelled "NoScript".

      --

      Ash and Hickory, straight-grained and true, make excellent bludgeons, dandy for the cudgeling of vegetarians.

    3. Re:I hope the list of tricks by jojoba_oil · · Score: 2

      I stopped taking NoScript seriously when they thought it was a good idea to deliberately disable AdBlock and obfuscate the code that did so.

    4. Re:I hope the list of tricks by GameboyRMH · · Score: 1

      No seriously though, NoScript doesn't prevent plain-HTTP tracking, which is gaining more and more popularity again these days and is used by Facebook.

      --
      "When information is power, privacy is freedom" - Jah-Wren Ryel
    5. Re:I hope the list of tricks by airdweller · · Score: 1

      Can you elaborate?

    6. Re:I hope the list of tricks by jojoba_oil · · Score: 1

      A good review of the issue was documented on the website of yet a different extension: DownThemAll! - Can I trust NoScript any longer?

      Basically, NoScript got upset that AdBlock made it possible to block ads on their site. (Note: by default, the NoScript site gets opened on every update.) So NoScript issued an update that crippled AdBlock's ability to block anything. This was discovered and NoScript, under pressure, changed to automatically add a forced white-list for their own site. Eventually, that was changed to allow opt-out, and then removed entirely. But the trust is still damaged; I haven't used NoScript since then.

  5. How's that again? by 93+Escort+Wagon · · Score: 4, Informative

    (how are you supposed to know if you should accept a new hosts public key, anyway?)

    Seriously? If you don't know enough about what's going on with the machine at the other end to make that decision... that's the whole bloody point of the warning!

    --
    #DeleteChrome
    1. Re:How's that again? by Speare · · Score: 1

      (how are you supposed to know if you should accept a new hosts public key, anyway?)

      Seriously? If you don't know enough about what's going on with the machine at the other end to make that decision... that's the whole bloody point of the warning!

      Just because you use SSH doesn't mean you administer the machine.

      I get a cheap ISP, it offers shell access to help me set up my scripts or website. I usually access it through the hostname I've attached with my DNS record: ssh shell.mydomain.com One day, they do some load balancing or something, and they shift my account to a different box. To me, it doesn't matter if they do that, but they don't exactly send out emails on each occasion. It has happened roughly three times a year for me. Every time I get the fingerprint-changed warning, it would be nice to have some confidence in it without resorting to the telephone. I can check whether the traceroute still goes to my ISP. I don't enter my password, I have already set up the account to trust my desktop's public key. Does the fact that they have my old SSH authorized_key file really mean there's no man-in-the-middle? (No.) At what point do I shrug and trust the new machine, vs calling up the ISP to get some info on the latest fingerprint change?

      --
      [ .sig file not found ]
    2. Re:How's that again? by Meeuw · · Score: 1

      I once enabled strict hostkey checking and created a global known hosts file, because all users had a (different, out dated) ~/.ssh/known_hosts. We had about 500 different SSH servers. I tried to explain why it is important not to send your credentials without checking the hostkey but no one understood it. Some (managers) even requested me to disable the host key checking altogether or let anyone update the known hosts automatically.

    3. Re:How's that again? by marcosdumay · · Score: 1

      At what point do I shrug and trust the new machine, vs calling up the ISP to get some info on the latest fingerprint change?

      At no point. That is because there is no way for them to tell you the new key (or even that the key changed) whitout the possiblity it was forged. You shouldn't trust an email either.

      The wrong thing here is that they are changing the keys. They shouldn't. If they have several servers pretending to be one, they should configure them to share the key and IP address.

    4. Re:How's that again? by nine-times · · Score: 1

      Yes, that is the point of the warning, but now that I've been warned, what's the proper next step?

      "OK, so I'm connecting to a server that I don't admin using SSH, and I don't already have the public key stored. So how do I know there's not a MITM attack going on?"

    5. Re:How's that again? by Anonymous Coward · · Score: 0

      At that point you are in roughly the same boat as when connecting to any TLS server that has a valid cert from one of the ridiculously many commercial CAs who are trusted by standard TLS client deployments to sign any and every FQDN on the Internet...

      The only real way to trust a remote server is if you can verify the key signature out of band, AND you trust the operators to be maintaining physical and logical security of the system. In practice, you need to think in terms of "how much" you trust the server, and avoid over-extending your risk for that level of trust.

      One way to minimize risk with SSH is to use public-key authentication and avoid typing passwords to the remote system; we disable password-based authentication in all our SSH daemon deployments. Another method is to use lots of throw-away passwords and minimize the loss when one password is disclosed. Much as you should with all the websites out there. But you also need to consider other risks such as agent-forwarding to an untrusted host, or giving your personal or financial details to an untrusted website... all very much the same kind of issue.

    6. Re:How's that again? by kasperd · · Score: 1

      One day, they do some load balancing or something, and they shift my account to a different box. To me, it doesn't matter if they do that, but they don't exactly send out emails on each occasion. It has happened roughly three times a year for me. Every time I get the fingerprint-changed warning, it would be nice to have some confidence in it without resorting to the telephone.

      I experienced something similar from a company that shall not be named here. I was responsible for a system that would ssh to their ssh server. But it turns out that the IP they had their hostname resolves to was actually some sort of loadbalancer, that would communicate with 3 or 4 actual ssh servers.

      On a couple of occasions they would put an incorrect key on one of those ssh servers. That meant successive TCP connections to port 22 would end up on different servers with different hostkeys.

      Naturally when I contacted them, I didn't ask them if their hostkeys had changed. Rather I insisted on them fixing their servers, such that we would consistently get the same hostkey when connecting to port 22 on that IP. That's not to say they can never change the hostkey, but if they do feel a need to change it, it is also their responsibility to ensure that it gets updated simultaneously on all the hosts, and to communicate the new public key in a secure way to their customers.

      Them being incompetent in managing ssh servers might have been more tolerable if they had been very competent in their primary field of business. Sadly, they demonstrated even more incompetence in their primary field of business.

      --

      Do you care about the security of your wireless mouse?
    7. Re:How's that again? by bill_mcgonigle · · Score: 1

      "OK, so I'm connecting to a server that I don't admin using SSH, and I don't already have the public key stored. So how do I know there's not a MITM attack going on?"

      Pick up the phone and talk to the admin.

      --
      My God, it's Full of Source!
      OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
    8. Re:How's that again? by nine-times · · Score: 1

      And if that's not an option?

    9. Re:How's that again? by halltk1983 · · Score: 1

      Find a service that allows you to talk to the admin after periods of maintenance.

      --
      Watch for Penguins, they eat Apples and throw rocks at Windows.
    10. Re:How's that again? by nine-times · · Score: 1

      What if this isn't after a period of maintenance? What if you don't control where the service is hosted?

      This isn't really a solved problem, so I can't blame you for not having a better answer.

    11. Re:How's that again? by halltk1983 · · Score: 1

      Whether the period was scheduled maintenance, or emergency maintenance due to failure, a failure should always result in the maintaining of the system, thus I call them all a "maintenance". What service do you or your company pay for that you or your company do not provide? If you or your company don't pay for it, then there are no guarantees. The hosting company I work for is available 24/7/365 or 24/7/366 on leap years. If you call Christmas afternoon, you will get someone working in our office here in the US. We may cos a bit more than some other carriers, but being able to talk to someone has always been worth it to me.

      --
      Watch for Penguins, they eat Apples and throw rocks at Windows.
  6. Most wanted feature which SSH lacks? by garo5 · · Score: 2

    I'd always have liked that I could transfer a file or an stdout/stdin stream directly in the middle of an open ssh session. Also the file transfer / stream should be carried over nested ssh connections.
    Imagine that you could just pipe the output from a command into some magical ssh command in a remote machine and your ssh client would ask where you would like to pipe the stream in your local machine.

    1. Re:Most wanted feature which SSH lacks? by allo · · Score: 2

      this is possible.

      first thing to look into:
      [enter]~?
      the ssh escape-key is ~, but only after a newline. and look out for deadkeys. ~? is a short help on this. There you can manage sub-connections and other stuff.
      ~. is very useful for terminating a ssh-process, which is still waiting for a network timeout.

      And multiplexing a single ssh-connection: read the manpage of ssh for "ControlMaster". then a unix-socket which contains username and hostname in the filename is used to use a single ssh-connection for multiple streams (shells, transfers, etc.)

    2. Re:Most wanted feature which SSH lacks? by kasperd · · Score: 1

      Imagine that you could just pipe the output from a command into some magical ssh command in a remote machine and your ssh client would ask where you would like to pipe the stream in your local machine.

      Sort of how zmodem would do over a serial line. If you have a typical terminal emulator and hook it up to a serial login on a Linux machine, you can type the command "sz <filename>", and once the sz command executes on the server it will send a message that the terminal emulator will understand an ask you where to store the file.

      I don't see any reason why the ssh client couldn't implement zmodem as well such that you could type the same sort of command in an ssh session and have the file stored on the client. However one might argue that such a feature doesn't belong in the ssh client, but rather in the terminal. You shouldn't expect such advanced features to show up in xterm any time soon, but why don't gnome-terminal or something similar support receiving files using zmodem? If the terminal supported it, then it should just work with ssh, rsh, telnet, rlogin, or even just su.

      --

      Do you care about the security of your wireless mouse?
  7. Wow by frodo+from+middle+ea · · Score: 5, Interesting
    Wow, ssh tunneling, and a few command line options , and screen, that's your ultimate SSH guide ?
    I am impressed, not!

    How about
    - ssh master connection, for svn+ssh ?
    - ssh agent forwarding
    - opening ssh ports using knocking
    - auto blacklisting with something like sshblack

    I think the above are more advanced options than the ones mentioned in the article, no ?

    --
    for the last time people, I am "frodo from middle eaRTH", not "middle eaST".
    1. Re:Wow by Anonymous Coward · · Score: 0

      > - ssh master connection, for svn+ssh ?

      Henceforth, I shall worship you as a god.

    2. Re:Wow by mlts · · Score: 3, Insightful

      I'd love to see stuff like that as well as:

      OpenSSH signed certificates (Not X.509) and TrustedUserCAKeys options and their usage. This way, I can hand a new cow-orker signed ssh host keys and assuming he or she knows enough not to just blindly replace a key if it isn't right, will minimize the chance of a MITM attack.

      Revoking SSH keys.

      Using SSHGuard to lock out brute force attempts.

      Proper configuration of the sshd_config file. Stuff like only allowing root in via RSA keys (or blocking root access entirely.)

      Auditing logs to know that key "A" ssh-ing to root is from user Alice, and key "B" is from Bob, so that one can tell who just wiped out the wrong filesystem come an inquiry.

      Running sshd as a user, not as root.

      Getting a backup program like NetBackup to form a ssh tunnel, do the backup, then close down the connection cleanly.

    3. Re:Wow by Qzukk · · Score: 1

      Or the key agent, or ~, or...

      --
      If I have been able to see further than others, it is because I bought a pair of binoculars.
    4. Re:Wow by ModernGeek · · Score: 1

      This is intermediate at best. I need to spend more time on IRC if I can expect to stay in the game.

      --
      Sig: I stole this sig.
    5. Re:Wow by jon3k · · Score: 1

      holy shit how have I never heard of this? and why don't I have mod points today! damn you slashdot commenting system!

    6. Re:Wow by Anonymous Coward · · Score: 0

      Why not x509? NIH much?

    7. Re:Wow by mlts · · Score: 1

      The certs in the latest version of OpenSSH are as lightweight as one can get... it is better than nothing though.

  8. 2600 article by buanzo · · Score: 1, Informative

    there's a 2600 article on how to use ssh to run commands in a very INTERESTING way.... check out the past 6 issues, cant remember which one.

    --
    Buanzo Consulting - 15 Years of GNU/Linux experience, for you.
    1. Re:2600 article by CubicleZombie · · Score: 1, Informative

      If you get an "Informative" mod for that, I'm giving up on Slashdot.

      --
      :wq
    2. Re:2600 article by nschubach · · Score: 1

      No, not Informative... even the GP said Interesting. ;)

      --
      Every time I start to have faith in humanity, I ruin it by driving to work between 7 and 8 am.
    3. Re:2600 article by CubicleZombie · · Score: 2

      Okay.

      There might be a story about how to do something INSIGHTFUL in a magazine I borrowed from someone a few months back in some place somewhere.

      Karma bonus, here I come...

      --
      :wq
    4. Re:2600 article by mattack2 · · Score: 1

      Buh-bye.

      (No, I wasn't one who modded it, especially after posting this.)

    5. Re:2600 article by Anonymous Coward · · Score: 0

      It was me (MichealKristopeit1246234324), after reading CubicleZombie. I expect a prompt farewell journal entry, a la Dr. Bob.

    6. Re:2600 article by tqk · · Score: 1

      If you get an "Informative" mod for that, I'm giving up on Slashdot.

      Er, bye? It's at +3 Informative as I look at it. BTW, don't discount his reading 2600. I used to too. Know thy enemy, and all that.

      --
      "Tongue tied and twisted, just an Earth bound misfit ..." -- Pink Floyd.
  9. Really lame by Anrego · · Score: 4, Informative

    Tip 16 and friends (the keyart stuff) is very poorly explained. You don’t know that the key is secure, but you magically know that the randomart is? That’s the bit they forgot to mention. It’s a visual representation of the key that _you have to have seen before to be able to verify_. Personally if you are going to go to the trouble.. I say throw the key on a USB stick and be done with it.

    The screen stuff maybe worth mentioning the more modern alternative tmux.

    SSHFS is better than NFS

    For quick one-off stuff .. maybe. Cryptographic overhead is still startlingly effective at slowing things down, even on fast hardware (random: can anyone explain why.. you’d think it shouldn’t make any difference at this point.. I’m guessing it has something to do with network framing?).

    Tip 4 (logging in with server-specific keys ) seems like the kind of thing that very few people will ever need to do.. and if they do.. they’ll google it. Kinda silly putting it in an article like this.

    Tip 2 (ssh tunnel) is probably the only thing in here that _might_ be considered an “ultimate” hack (everything else is pretty much Linux 101).

    Tip 1 (Evading silly web restrictions) is great. Alternate title: “my job is important, but damnit I need my facebook/twitter fix”.

    1. Re:Really lame by Anonymous Coward · · Score: 0

      You can run ssh without encryption (at least after hacking the source). I'm quite sure the issue is more likely with sshfs than encryption.
      The problem I have seen is that the Linux kernel just sucks to various degrees when doing proper readahead.
      With NFS I suspect it mostly works or it uses larger blocks in the first place.
      But for example if you read 4 kB at a time via SMB it will indeed only request 4 kB each time, even if you always read completely linearly. This means you get 16x the round-trip latency over when you are reading 64 kB at a time.
      sshfs probably has the same issue, and it totally kills performance over anything that does not have very low latency.

    2. Re:Really lame by Anonymous Coward · · Score: 3, Interesting

      Any clued network admin will eventually get wind of a ssh connection going to the same box from someone's workstation, especially if there is a lot of traffic going to and from it. Then, depending on how much they like/dislike the person with the tunnel, they will either ignore it, mention to be careful about PPP over SSH in passing, randomly kill the connection, block the destination IP at the router, block ssh from going outside from that workstation, or just sit there, watch statistics, then present HR with a case that a user is doing something they shouldn't by constantly sending encrypted traffic to a box that isn't owned by the company or anyone relevant. That right there is good enough to get someone sacked in most companies, especially ones with more paranoid and clueless PHBs.

      Of course, one can ssh to a different port, but most IDS/IPS systems can detect a bunch of encrypted traffic over a TCP port and send a note to the admins, or just automatically lock the workstation out from the rest of the network.

      So, the guide of using ssh as a tunnel is just plain stupid, and a good way to get fired for gross misconduct (which means no unemployment).

    3. Re:Really lame by Anonymous Coward · · Score: 5, Informative

      I am the developper of libssh (www.libssh.org).
      SSHFS is slow because it's a packet based TCP-encapsulated file transfer protocol. All requests are initiated by the client and somewhat replied to by the server in an asynchronous design, but in practice no sftp server really has an asynchronous implementation. Opening a file, querying its length and downloading 8KiB require at least 3 or 4 RTT.
      Compare with NFS, UDP based and mostly kernel-land and fully asynchronous.
      Crypto is the main overhead in libssh and I suspect in openssh too, mainly because the crypto libs used do not probe for AES extensions or accelerators by default. And last but not least, OpenSSH's Channel window handling (similar to TCP windows) is not optimal for bulk transfers at high speed.
      There are also some remote filesystem features missing in SFTP, like server-send feedback, locks and friends.

    4. Re:Really lame by Anonymous Coward · · Score: 1

      I use server specific keys daily. Any competent sysadmin really should. And I'm just...well.. probably really 'devops'

      Here's the blunt:
            There's a firewall. It's controlled by people above us. We have permission to install and configure a VPN, but not to edit the firewall rules. People are encouraged to use gotomypc ... etc.

      My desktop runs autossh with a ssh-agent and password protected key. SSH reverse tunnels out to a tiny server I have running at home, using a server specific fixed key to a local user account on a passwordless shell. The user account is firewalled to do *NOTHING* but the reverse forward.

      From home, I login to that box as another user, grab the port forward--and am now ssh tunneled into the office.

      I have full X11 forwarding, RDP, VNC, and am past the firewall and NAT layer.

      Without permission to VPN, this might be a big "no-no"...but this is frankly better than any client VPN out there. With standard linux tools, I can pull my desktop to anywhere I am. If the double networking is any sort of issue--I simply need to ssh in and start another autossh job to the public IP of my laptop (if it exists).

      I've got password authentication, key and SSHD authentication. And even if somebody compromises my remote server entirely --the most they can do is gain access to my work desktop's SSHD port. Which is going to require a good key to do anything.

      Beyond that, it's a *great* temporary hack when you have slow developers. Sure, it's no real substitute for RPC -- but have a command on the system you want to expose to "bob", but don't trust him with a shell? Give him a copy of putty, a key you generated, and a fixed command on the server that *only* runs that. You can also change his shell if you're really paranoid.

      Need a makeshift RPC service because you've got machines separated across the LAN, no permission to bridge a VPN? Or punch the port through the firewall? Oh... IT has ssh installed and they already use it. There you go -- blast through procedure and process to install a non-user account, provide a script that runs the single needed command, and associate it to a key. You now have a secure, authenticated remote service that lasts as long as it needs on a terminal.

      Just don't do something idiotic like attach it to a psql shell or the less command.

      I mean, I'll admit -- in an enterprise, all of these SHOULD be better developed. But when you need something solved in twenty minutes -- SSH to the damned rescue. It's secure, uses any type of authentication you might require, is usually already permitted, and can be locked down to any purpose you can imagine trivially.

    5. Re:Really lame by Qzukk · · Score: 1

      (random: can anyone explain why.. you’d think it shouldn’t make any difference at this point.. I’m guessing it has something to do with network framing?)

      What happened is that advances in communication at the kernel has made everything else MUCH faster. System calls like sendfile() basically tell the kernel to dump everything in the file to that port and don't bother me until you're done, which eliminates all of the syscall context switching overhead for read()ing data from the file to a buffer then write()ing the buffer to the socket and maybe a select() or epoll() thrown in there, etc.

      The only way to get this benefit with openssl is if you had the file pre-encrypted on the drive somewhere, somehow (each session is a new key, so not likely to happen). You could write the file on the fly, but then you might as well just write to the network instead of writing to a file and telling the kernel to send it later.

      --
      If I have been able to see further than others, it is because I bought a pair of binoculars.
    6. Re:Really lame by hawkinspeter · · Score: 1

      As much as I like SSH (it's probably my most used tool), an IPSEC based VPN should give better performance. Have a look at http://sites.inka.de/bigred/devel/tcp-tcp.html/ for a brief explanation of the problems with tunnelling TCP over TCP.

      My favourite SSH trick is using SSHFS along with AUTOFS to automagically connect to other servers' filesystems. Again, not the best performance, but as long as the server is running an SSH daemon, you're good to go.

      --
      You're a temporary arrangement of matter sliding towards oblivion in a cold, uncaring universe
    7. Re:Really lame by Tanktalus · · Score: 1

      sshfs is better than NFS. For

      • switching between many different servers quickly, easily, and without jumping to root each time.
      • penetrating firewalls (ssh port may be allowed, but nfs port usually isn't)

      I'm sure there are other uses, too, where NFS might perform better but sshfs provides a level of convenience as a fully user-mode filesystem that outweighs it.

      I have a unit test wrapper that takes the name of a machine to test against, automatically penetrates firewalls (using https and DBus + KWallet for passwords) when the machine is behind a firewall, mounts the remote filesystem via sshfs, copies tests to run, runs them via ssh, and reports everything back on my desktop. And I can switch from machine to machine trivially. Without aggravating IT. They've already approved my access to the machine (user account, firewall access), and approved ssh access. They don't like NFS, especially for VPN-based clients (roving IP address). I'm happy, they're happy, I get my job done.

      I only wish I had found sshfs years ago. This would have made earlier jobs so much easier.

    8. Re:Really lame by Anonymous Coward · · Score: 0

      I've gotta agree on the SSHFS/NFS thing--I dumped SSHFS a while ago because I got tired of encrypting/decrypting a 300MB video file every time I wanted to move it around the network.

      I know you can run it w/o encryption, but NFS is a MUCH better solution for standard file sharing.

  10. SSh tunnel by Krneki · · Score: 1, Funny

    SSh tunneling is teh sex.

    --
    Love many, trust a few, do harm to none.
  11. Beyond the shell by pak9rabid · · Score: 1

    Anybody that knows what they're doing already knows this, but since /. is quickly becoming a refuge for retards, other uses for SSH also include:

    1.) File transfers between 2 hosts (via scp or sftp)
    2.) Tunnelling (aka the "poor man's VPN"...great for accessing hosts behind a Unix-based firewall securely without having to setup additional DNAT rules)

    1. Re:Beyond the shell by Anonymous Coward · · Score: 0

      Hey be nice. Ya, a lot of us already know this stuff but there are kids just getting into the scene that don't yet.

  12. Remote TCP port forwarding by aglider · · Score: 1

    My favorite is to use SSH remote port forwarding (-R) to allow my machines to connect back home from an unknown (and possibly changing) IP and then allow me to ssh back to them. And key authentication all the way along!
    And, by the way, SSH tunneling is not TCP port forwarding!

    --
    Sent as ripples into the electromagnetic field. No single photon has been harmed in the process.
    1. Re:Remote TCP port forwarding by tramp · · Score: 1

      Indeed SSH tunneling is not TCP port forwarding and if you want something like that, you should use shuttle (https://github.com/apenwarr/sshuttle).

    2. Re:Remote TCP port forwarding by jon3k · · Score: 1

      I've always referred to this as a "reverse tunnel". It's awesome if you have a shell somewhere and you want to be able to get back into a machine at your house that's behind a firewall.

  13. Should have been titled "ssh basics". by Anonymous Coward · · Score: 2, Interesting

    Also... screen? When there's tmux???

    1. Re:Should have been titled "ssh basics". by tscheez · · Score: 3, Insightful

      I'd never used tmux. i've officially learned more from /. comments than the actual articles. Thanks!

      --
      Supplies!
  14. Connection Multiplexing by igglepiggle · · Score: 2

    Having multiple sessions over the same connection speeds up repeat connections: http://blogs.perl.org/users/smylers/2011/08/ssh-productivity-tips.html It's well worth setting up.

    1. Re:Connection Multiplexing by Elrond,+Duke+of+URL · · Score: 1

      Connection multiplexing is great. I use it all the time when I connect to my machine at work from home since I'm very likely to scp files to/from that machine at the same time. The page you linked to gives simple and good instructions at the beginning on how to configure it.

      I created a simple shell script to help automate the process. The advantage of the script is that it will take care of checking to see if the shared connection is already open, create a new connection if one does not exist, and then connect to the remote host.

      ssh-shared.sh

      The script includes a large comment block at the beginning which includes detailed instructions on how to configure SSH and how to use the script. After you have configured your ~/.ssh/config file for the server(s) in question and to create the multiplexing socket, you can use this script to connect to the machine. Put it in your user bin directory (~/bin) and then create a symlink to the script with the same name as the host alias you put in ~/.ssh/config. For example, if you have a "Host foo" line in your SSH config, name the symlink "foo". This way the script will automatically use the correct options from the config file.

      I also have an alias to close the connection (for Bash):

      alias ssh-exit='ssh -O exit'

      Now, a session will look like this:

      $ foo
      --SSH session starts/ends--
      $ ssh-exit foo

      --
      Elrond, Duke of URL
      "This is the most fun I've had without being drenched in the blood of my enemies!"-Sam&Max
  15. The MITM 'help' is worthless. by Junta · · Score: 2

    Basically they go into some detail about the ascii art representation, and at the end acknowledge that you need to securely get the keys to know what to expect. If you have a secure means of getting the ascii art, you have a secure means of getting the key. The only exception I can think of is if you have someone cell-phone picturing the local console, which could be helpful.

    The real useful thing would be for people to do DNSSEC and SSHFP records.

    --
    XML is like violence. If it doesn't solve the problem, use more.
  16. My fav by Anonymous Coward · · Score: 4, Interesting

    Rather than more complaining, I thought I'd say my favorite option. I like using the ~/.ssh/config file and the use of a master connection. In mine, I have:

    host *
      controlmaster auth
      controlpath ~/.ssh/ssh-%r@%h:%p
      controlpersist yes

    This creates a master socket on my client. When I first connect, I need to use my passphrase. But when I exit, the SSH tunnel stays up. Futher connections via SSH and sftp and scp use this connection, multiplexed. So no more asking from my passphrase. When I'm finished for the day, I close down the connection with

    ssh -O exit host

    replacing "host"

    1. Re:My fav by Anonymous Coward · · Score: 0

      Don't trade security for convenience. If you can trust your client machine 100%, go for it.

    2. Re:My fav by Barnoid · · Score: 2

      one of my favorites, too. small correction for those who actually try it out: it should be controlmaster auto, not auth.

      ~/.ssh/config

      host *
        controlmaster auto
        controlpath ~/.ssh/ssh-%r@%h:%p
        controlpersist yes

      This creates a master socket on my client. When I first connect, I need to use my passphrase. But when I exit, the SSH tunnel stays up. Futher connections via SSH and sftp and scp use this connection, multiplexed. So no more asking from my passphrase. When I'm finished for the day, I close down the connection with

      ssh -O exit host

      replacing "host"

  17. Need more performance? by Anonymous Coward · · Score: 0

    Multi-threaded SSH is a pretty nifty patch for getting more out of your ssh connections.

  18. Comment removed by account_deleted · · Score: 2

    Comment removed based on user account deletion

  19. Comment removed by account_deleted · · Score: 5, Informative

    Comment removed based on user account deletion

  20. HTTP Proxy by bambewn · · Score: 1

    I had forgot about this for a while due to VPN shenanigans, but tunneling your web traffic through an SSH is a great way to secure your web sessions if you don't have a VPN setup. I have also found that using Cygwin/SSH to secure your RDP can also be pretty boss if you have to work on M$ machines from remote very often.

  21. SSH Feature Wish: Server policy on SSH keys by linuxtelephony · · Score: 3, Interesting

    I wish it was possible to require SSH keys for some (or even all) users to have a passphrase, and enforce this requirement on the server.

    As it stands right now, even if you generate a key for someone with a pass phrase, they can remove it easily on the client side and the server has no way of knowing. This means you could have passwordless logins to remote systems. Not good.

    At least with modern systems and key agents you can get passwordless ease of use once you log into your local account, and if someone happens to get your private key they don't immediately have instant access to the machines you can log into. You should have a little time to secure the machines. [Think lost/stolen laptop or backup drive.]

    --
    . 62,400 repetitions make one truth -- Brave New World, Aldous Huxley
    1. Re:SSH Feature Wish: Server policy on SSH keys by Erpo · · Score: 1

      I wish it was possible to require SSH keys for some (or even all) users to have a passphrase, and enforce this requirement on the server.

      As it stands right now, even if you generate a key for someone with a pass phrase, they can remove it easily on the client side and the server has no way of knowing. This means you could have passwordless logins to remote systems. Not good.

      Such a policy would require the server to take the client's word for it that the private key was encrypted with a passphrase.

      At least with modern systems and key agents you can get passwordless ease of use once you log into your local account, and if someone happens to get your private key they don't immediately have instant access to the machines you can log into. You should have a little time to secure the machines. [Think lost/stolen laptop or backup drive.]

      Agreed. If someone is removing the passphrase from their private key, there is some other problem that needs to be solved. Personally, I like ecryptfs for my home directory and LUKS for my backup drive with the LUKS passphrase inside my login keyring.

    2. Re:SSH Feature Wish: Server policy on SSH keys by allo · · Score: 1

      how is the server supposed to check, if the key is really using a password?

    3. Re:SSH Feature Wish: Server policy on SSH keys by lindi · · Score: 1

      Passphrases on SSH keys help if somebody steals your backups but for almost anything else they are not very useful. If you somehow get access to the encrypted key of some user you very often also have access to their ~/.bashrc. Then you can easily trojan PATH that so that their passphrase is emailed to you next time they type it.

    4. Re:SSH Feature Wish: Server policy on SSH keys by Anonymous Coward · · Score: 0

      I wish it was possible to require SSH keys for some (or even all) users to have a passphrase, and enforce this requirement on the server.

      As it stands right now, even if you generate a key for someone with a pass phrase, they can remove it easily on the client side and the server has no way of knowing. This means you could have passwordless logins to remote systems. Not good.

      Such a policy would require the server to take the client's word for it that the private key was encrypted with a passphrase.

      You can use the openssl commandline tools to see if you can decrypt the private key with an empty passphrase. Something like.

        EMPTY_PW="" openssl rsa -pubout -passin env:EMPTY_PW /path/to/private/key.file

      and then check the return value. If you can decrypt the private key, its got no passphrase.

    5. Re:SSH Feature Wish: Server policy on SSH keys by Anonymous Coward · · Score: 0

      I wish it was possible to require SSH keys for some (or even all) users to have a passphrase, and enforce this requirement on the server.

      As it stands right now, even if you generate a key for someone with a pass phrase, they can remove it easily on the client side and the server has no way of knowing. This means you could have passwordless logins to remote systems. Not good.

      Such a policy would require the server to take the client's word for it that the private key was encrypted with a passphrase.

      You can use the openssl commandline tools to see if you can decrypt the private key with an empty passphrase. Something like.

      EMPTY_PW="" openssl rsa -pubout -passin env:EMPTY_PW /path/to/private/key.file

      and then check the return value. If you can decrypt the private key, its got no passphrase.

      Your solution works client-side. The question was how the server would know whether the private key is encrypted or not.

  22. This Article's True Purpose by preaction · · Score: 5, Insightful

    Get real SSH tips from people complaining (rightly or not) that it doesn't contain any actual advice.

  23. Re:_slashdot_ at it again by Anonymous Coward · · Score: 1

    there, fixed that for ya.

    i want the old slashdot back. i could put up with the general
    technical ability around here dropping, but when slashdot assumes
    we're all managers, that pisses me off.

    here's who infoworld is aimed at
    http://search.dilbert.com/search?w=trade+magazine&view=list&filter=type%3Acomic

  24. Re:On the other hand, you could buy the book by Anonymous Coward · · Score: 0, Informative

    ...well-regarded in the OpenBSD community.

    That is to say, both of them agree.

  25. Never talk about speed by droidsURlooking4 · · Score: 0

    How about an article discussing the pros and cons of various types of encryption including speed. Actually, what is the fastest encrypted file transfer protocol (don't say ftp in a vpn)? SCP seems to really fall down here.

  26. I live in the post-SSH world by DrSkwid · · Score: 1

    the 1970s was cool and all

    --
    There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
    1. Re:I live in the post-SSH world by Anonymous Coward · · Score: 0

      Wow, you're only off by two decades or so....

    2. Re:I live in the post-SSH world by Anonymous Coward · · Score: 0

      So what year did humans learn to send messages back in time? And can you tell me next week's lottery numbers?

  27. Speedwise by marcovje · · Score: 1

    Speedwise, ssh -2 still holds up my Mac 840AV up for several minutes to login :-)

    1. Re:Speedwise by Anonymous Coward · · Score: 0

      Might be that your ssh_config file isn't quite optimized for what you are connecting to. I find commenting out the lines on GSA speeds up my initial login quite significantly.

  28. The article sucks, but here's some extra stuff by Anonymous Coward · · Score: 0

    First off there is this beauty called ssh-agent, which allows for SSO functionality; ssh-agent requests can be forwarded and tunelled through multiple ssh hops (although agent forwarding places some extra trust in the other machine's admin). You can use ssh-agent as a PAM authentication module, so that you don't have to use your password for sudoing etc.

    A poor man's VPN can be done by placing pppd at both ends of the ssh connection. In newer version, ssh can do this automatically via tun device redirection.

    Little is known about the 'ssh command line' activated via ~C where you can add/remove/edit port forwards for current session.

    SSH keys support certification authority scheme similar to SSL keys.

    And finally a lot of magical and wonderful things can be created by mastering the ssh daemon configuration (especially wrt authorized_keys).

  29. Wikibook on OpenSSH by SgtChaireBourne · · Score: 1

    The has also been a WIkibook on OpenSSH out for a year or so. The prose may not be the best but the tips are there.

    --
    Beta is broken and the link to classic doesn't work. Stop wasting our time or there won't be anybody left here.
  30. My SSH Utility by merc · · Score: 1

    Feel free to check out a little perl utility I wrote for creating aliases or shortcuts for remote ssh logins. If you have a lot of hosts to manage it can make your life easier:

    http://www.cpan.org/authors/id/L/LD/LDAVIS/remote-ssh-access-1.7

    Download the file, name it "remote-ssh-access". To read the perl documentation just use "perldoc remote-ssh-access"

    --
    It's true no man is an island, but if you take a bunch of dead guys and tie 'em together, they make a good raft.
    1. Re:My SSH Utility by Anonymous Coward · · Score: 0

      WHAT. THE. FUCK.

      Ever heard of ~/.ssh/config? Also, the docs alone tell me how fugly and hackish the code must be:

      "Do not install this script in a directory such as /usr/local/bin. This is because:
      1. Non-privileged users need write access to the same directory.
      2. This script makes use of hard links."

      Not to mention the fact that what this atrocity does can be done in some lines of shell.

      Why is it that every self-entitled asshole without basic UNIX clues needs to grab an oversized interpreter and pester the world with their demonstrated lack of skill?

  31. "root login over SSH is considered [...] unsafe" by Anonymous Coward · · Score: 1

    > The example assumes you have a sudo user set up with appropriate restrictions,
    > because allowing a root login over SSH is considered an unsafe practice.

    Yeah, because an attacker that has succesfully cracked your sudo account will NEVER come up with the idea to alias your su/sudo command so that it mails him the password.

  32. Comment removed by account_deleted · · Score: 1

    Comment removed based on user account deletion

  33. Look into SSH-capable config management frameworks by Anonymous Coward · · Score: 0

    example -- http://ansible.github.com

  34. Please sit down and shut up. by suso · · Score: 2, Insightful

    OP should be -1 overrated. You jerks who keep saying things like "everyone is doing X because I am" or "this isn't knew" or "this isn't important" really need to STFU. There are people coming into the world all the time who haven't learned what you learned or had the same experiences that you do. Much of what you learned from is burried now under mountains of information and its very often not clear where people should start from. So sit down, shut up and let others learn, otherwise all you will do is scare them away so that they never will. Not everything is some conspiracy to generate ad revenue.

    1. Re:Please sit down and shut up. by MasterMan · · Score: 0

      Yes, there are new people coming into computer stuff and learning new things every day, young and old. The problem is that this article, overall, is crap. 14/16 of the tips are something that no single novice actually needs to know. The rest two tips are something that are really basic SSH features and widely anknowledged in every book or tutorial about SSH. Lastly, how is this "news"?

      InfoWorld has a long history of doing this. It is not some huge conspiracy, it's simple. I actually feel bad for bashing the article because the author does know her stuff. But Slashdot is not place for it. However, I am quite certain that InfoWorld has an internal policy of submitting all their articles to Slashdot by their authors or relevant persons because it's such a constant pattern, with link dropping for very specific and good keywords. This means they first get traffic from Slashdot, but also increase the article in Google and other search engines, dropping off more useful tutorials. And isn't pretty much anyone on Slashdot tired of the shitty SEO spam techniques that pollute search results?

    2. Re:Please sit down and shut up. by Anonymous Coward · · Score: 0

      Conversely, is this /, or the Khan Academy? Expected levels of competence define the lower and upper end of the audience. /.'s core reputation is(was) being a place where smart nerds check the news and post. Too much of this, and we lose the upper end that makes /. different.

      One of the greatest things about /. in the beginning was the name. In the beginning you found out most things offline first. "Hey there's this great site you should check out." "What's the URL? ... wait, what?" That set the tone magnificently. The place expected and respected a certain level and type of intelligence.

    3. Re:Please sit down and shut up. by kangsterizer · · Score: 1

      man ssh
      now that wasnt so hard, was it?

      not buried. not long to read. precise, complete, concise and standard. you "really need to RTFM"

    4. Re:Please sit down and shut up. by Ash-Fox · · Score: 1

      man ssh
      now that wasnt so hard, was it?

      I don't have a problem using SSH, however, your advice may not actually work for some machines, like mine.

      $ man ssh
      No manual entry for ssh

      However, I assure you, SSH installed on my system:

      $ ssh -V
      OpenSSH_5.8p1, OpenSSL 0.9.8r 8 Feb 2011

      --
      Change is certain; progress is not obligatory.
    5. Re:Please sit down and shut up. by suso · · Score: 1

      InfoWorld has a long history of doing this. It is not some huge conspiracy, it's simple. I actually feel bad for bashing the article because the author does know her stuff. But Slashdot is not place for it. However, I am quite certain that InfoWorld has an internal policy of submitting all their articles to Slashdot by their authors or relevant persons because it's such a constant pattern, with link dropping for very specific and good keywords. This means they first get traffic from Slashdot, but also increase the article in Google and other search engines, dropping off more useful tutorials. And isn't pretty much anyone on Slashdot tired of the shitty SEO spam techniques that pollute search results?

      Yeah. They are a business. Try running one sometime and you'll understand why they do what they do.

    6. Re:Please sit down and shut up. by stridebird · · Score: 1

      So no man for you then. However, I don't think this problem is insurmountable.
      1) The man pages may well be on your machine but not in the configured man path
      2) google.com?q=man+ssh

  35. Personally I like by Rich · · Score: 3, Interesting

    tar cf - somedir | ssh remote@remotehost 'tar xf -'

    A nice way to get things moved around. a similar trick is:

    tar cf - somedir | (cd /a/local/path; tar xf - )

    Which lets you copy things around a local file system.

    1. Re:Personally I like by rdebath · · Score: 1

      I used to use this, but I tend to use rsync nowadays; it automatically does something very similar (only better in that the physical copy only copies new data) in a fraction of the command size. And it has it's -P argument.

      rsync -PAX -Hax somedir remote@remotehost:/a/remote/path

    2. Re:Personally I like by zumajim · · Score: 1

      And since this post was originally about SSH, why not add '-e ssh' to tunnel rsync over a secure connection?

    3. Re:Personally I like by Anonymous Coward · · Score: 0

      Would it be better to include -z so the stream is compressed?

    4. Re:Personally I like by jon3k · · Score: 1

      very cool! never thought about piping output to ssh before. another wonderful trick that i'll forget 5 minutes from now.

    5. Re:Personally I like by Anonymous Coward · · Score: 0

      tar cf - somedir | ssh remote@remotehost 'tar xf -'

      A nice way to get things moved around. a similar trick is:

      tar cf - somedir | (cd /a/local/path; tar xf - )

      Which lets you copy things around a local file system.

      And this is better than plain old scp -r because...?

    6. Re:Personally I like by Anonymous Coward · · Score: 0

      that's cool thanks for posting!

    7. Re:Personally I like by Anonymous Coward · · Score: 0

      That's what tar's -C switch is for.

    8. Re:Personally I like by rdebath · · Score: 1

      Because that's the default if you have a single colon like in my example.

      rsync -PAX -Hax somedir remote@remotehost::module/remote/path
      This is for a bare rsync server, (or use rsync:// )

    9. Re:Personally I like by Anonymous Coward · · Score: 0

      why don't you: tar -cf - somedir | tar -C /a/local/path -xf -

  36. arcfour is fast by Enolas · · Score: 1

    Real trick here, if you're using ssh -L often use: -c arcfour, that cipher is very fast.

  37. Author forgot to tunnel DNS by Anonymous Coward · · Score: 0

    On the last example , they tunnel http thru the ssh, but leave the DNS queries exposed.
    Author forgot to set Firefox to tunnel DNS requests, alot of danger is still exposed via DNS.
    Author is a noob, who just discovered ssh, and now cant shut up about it.

    Hashie
    @ TrYPNET.net

    1. Re:Author forgot to tunnel DNS by kasperd · · Score: 1

      Author forgot to set Firefox to tunnel DNS requests, alot of danger is still exposed via DNS.

      Why is it that Firefox sets network.proxy.socks_remote_dns to false by default? I know of several scenarios where setting it to true works better than setting it to false. I don't know of any situation where the default value is actually better.

      --

      Do you care about the security of your wireless mouse?
  38. Comment removed by account_deleted · · Score: 2

    Comment removed based on user account deletion

  39. Meh by Anonymous Coward · · Score: 0

    Couple of good ones there.

    Didn't mention my two favourites:

    1) Loop a -R and a -L to handily crash the server

    2) Use tunnelling to gain access to services that you, as a plain old unprivileged local user, aren't supposed to have access to

  40. MONKEY in the middle? by Galestar · · Score: 1

    Good old Infoworld, doesn't know the difference between Monkey-in-the-Middle and Man-in-the-Middle

    --
    AccountKiller
  41. SSHFP records in your DNS zone by stderr_dk · · Score: 1
    ssh-keygen -r example.com.

    Add the output to your DNS and set VerifyHostKeyDNS to "yes" or "ask" in your ssh_config.

    Remember to update your DNS if/when your machine gets a new SSH hostkey.

    --
    alias sudo="echo make it yourself #" ; # https://pipedot.org/~stderr & http://soylentnews.org/~stderr
    1. Re:SSHFP records in your DNS zone by FoolishOwl · · Score: 1

      Why is this useful?

    2. Re:SSHFP records in your DNS zone by stderr_dk · · Score: 2

      Let me demonstrate the difference with some examples.

      First a normal ssh connection to a new host. Without VerifyHostKeyDNS it doesn't matter if your SSHFP records are up-to-date, since they won't be checked.

      $ ssh login@example.com
      The authenticity of host 'example.com (127.0.0.1)' can't be established.
      RSA key fingerprint is 01:23:45:67:89:ab:cd:ef:01:23:45:67:89:ab:cd:ef.
      Are you sure you want to continue connecting (yes/no)?

      With "VerifyHostKeyDNS yes" and up-to-date SSHFP records, it looks like this instead. Note the extra line of output.

      $ ssh -o "VerifyHostKeyDNS yes" login@example.com
      The authenticity of host 'example.com (127.0.0.1)' can't be established.
      RSA key fingerprint is 01:23:45:67:89:ab:cd:ef:01:23:45:67:89:ab:cd:ef.
      Matching host key fingerprint found in DNS.
      Are you sure you want to continue connecting (yes/no)?

      And this is what you get, if the SSHFP record ain't up-to-date:

      $ ssh -o "VerifyHostKeyDNS yes" login@example.com
      [Cut long line of @'s. Too many 'junk' characters for /.]
      @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
      [Cut long line of @'s]
      IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
      Someone could be eavesdropping on you right now (man-in-the-middle attack)!
      It is also possible that the RSA host key has just been changed.
      The fingerprint for the RSA key sent by the remote host is
      01:23:45:67:89:ab:cd:ef:01:23:45:67:89:ab:cd:ef.
      Please contact your system administrator.
      Update the SSHFP RR in DNS with the new host key to get rid of this message.
      The authenticity of host 'example.com (127.0.0.1)' can't be established.
      RSA key fingerprint is 01:23:45:67:89:ab:cd:ef:01:23:45:67:89:ab:cd:ef.
      No matching host key fingerprint found in DNS.
      Are you sure you want to continue connecting (yes/no)?

      Compare that with the first case where you had absolutely no idea if the fingerprint was correct or not.

      I'm not saying, you should just trust all SSHFP records, if you're paranoid. But even if you ain't paranoid, the warning about the mismatching SSHFP record should be enough to make you stop and think instead of just saying yes.

      --
      alias sudo="echo make it yourself #" ; # https://pipedot.org/~stderr & http://soylentnews.org/~stderr
    3. Re:SSHFP records in your DNS zone by FoolishOwl · · Score: 1

      Thank you. That was well-written and clear.

  42. Not necessarily malicious by Weaselmancer · · Score: 1

    And it's not a common practice to log down telnet traffic. Anyone who gets your telnet password is probably sniffing maliciously.

    Yeah, that is the most likely scenario. But I work in embedded design. And even though we've screamed to have two networks in the office it hasn't happened. So that means DUT and the office computers are on the same net. I've had to work on ethernet drivers that were malfunctioning. So I downloaded Ethereal (now Wireshark) to debug.

    And was immediately and completely horrified at what I saw.

    The very next thing I did was to set up a proxy server at home and get zebedee working (windows environment - ssh would have been difficult) and proxy everything I do.

    --
    Weaselmancer
    rediculous.
  43. SSH Mastery, new book by Lucas by austinhook · · Score: 1

    While on the topic, note the new book by Michael Lucas:
    http://www.michaelwlucas.com/nonfiction/ssh-mastery

  44. Re:On the other hand, you could buy the book by tqk · · Score: 1

    ...well-regarded in the OpenBSD community.

    That is to say, both of them agree.

    Ever seen an OpenBSD hackathon? I have. I'd guess 75 people were there, and that's just the devs who could make it.

    A$$hole.

    --
    "Tongue tied and twisted, just an Earth bound misfit ..." -- Pink Floyd.
  45. InfoWorld Advertising by jon3k · · Score: 1

    If you seriously haven't figured it out yet, InfoWorld is obviously paying slashdot editors to post articles. I don't know how it could possibly be any more obvious.

  46. Remote sound with video on a low-end box by Demonoid-Penguin · · Score: 1

    Host medium to high powered and have pulseaudio installed using a decent distro like Debian (Ewebuntu is broken). Enable network sound.
    Client old laptop with minimal install that includes pulseaudio. For Debian you need to enable ForwardX11Trusted. Login to the Host box using "ssh -XC vlc". Now enjoy movies without stuttering sound or dropped frames on a box that would struggle to run W95. 32MB of RAM will work fine.

  47. ProxyCommand is teh awesome by Just+Some+Guy · · Score: 1

    My personal favorite "trick":

    .Host *.example.com
    .....ProxyCommand ssh -W %h:%p bastionhost.example.com

    Add the above to ~/.ssh/config, and from then on I can SSH to machines inside my company's firewall by first connecting to a secured bastion host, just by running ssh internalmachine.example.com. If you do a lot of work from home, or have specially secured machines at the office that require intermediate connections, you can set up proxying and make it automatic and easy to connect to them.

    --
    Dewey, what part of this looks like authorities should be involved?
    1. Re:ProxyCommand is teh awesome by jampola · · Score: 1

      This is a good one. I've really got to start playing with the config file in ~/.ssh/ more often. What a thrilling life I lead!

    2. Re:ProxyCommand is teh awesome by gatkinso · · Score: 1

      Much nicer than a reverse ssh tunnel!

      --
      I am very small, utmostly microscopic.
  48. commandlinefu by jampola · · Score: 1

    www.commandlinefu.com - Some more shameless advertising for a site I have nothing to do with apart from frequenting quite often!

    Probably one of the cooler tricks I saw the other day was being able to ssh into a remote box and push the signal from your pc mic onto the remote machines speakers and vice versa!

    Lot's of fun was had in our office that day!

  49. my #1 hack by no-karma-no-worries · · Score: 2

    man ssh

  50. Further exploration by swehack · · Score: 1

    Here are some interesting projects you can progress with after reading this article.

    1. ansible - python, paramiko and jinja based puppet replacement using ssh instead of re-invented wheel
    2. mussh - multi ssh sessions using native openssh facilities such as .ssh/config
    3. clusterssh - pretty much same as above, stands out from ansible for using openssh facilities
  51. tip #3 was news for me, thanks! by anarcat · · Score: 1

    I was also a bit surprised to see basic stuff and some repetition in the article there, but trick #3 was really nice for me:

    ssh-keygen -R remote-hostname

    This will remove the entry for remote-hostname in the known_hosts file, for example if you know the key changed or (don't do that) if you think you're in a MITM attack and don't care.

    now that will fix many countless fiddling around the known_hosts file...

    --
    Semantics is the gravity of abstraction
  52. Also, remember MW Lucas' new ssh book by badger.foo · · Score: 1

    I think it's worth mentioning to anybody who enjoyed this article that Michael W. Lucas has a fresh SSH book out called 'SSH Mastery'. Initially an ebook, but becoming available right about now in a paper version too.

    Amazon will have it, or if you're shopping for OpenBSD stuff anyway (as you should, OpenSSH which is almost certainly the ssh and sshd on your system, is essentially an in-tree development at OpenBSD), www.openbsd.org/books.html and tentacles of the ordering system will show you where to get it.

    --
    -- That grumpy BSD guy - http://bsdly.blogspot.com/
  53. Re:_slashdot_ at it again by thereitis · · Score: 1
    What's to stop anyone from creating their own site? Slashcode is free. Meld that with something like digg (except with clueful readers) and the users can control the submissions (since your gripe seems to be with the editors of this site). Sounds easy, but I'll bet it isn't.

    My guess is the editors have so many stories to choose from, they've got some keyword filters set up and pick out of that lot. That would explain why there are so many stories along the same lines, which gets kind of repetitive.

  54. remote sniffing! by Washuu2 · · Score: 1

    ssh root@10.0.0.245 "tcpdump -l -n -s 0 -w -not port 22" wireshark-i -

  55. FoxyProxy and -D go together nicely by Anonymous Coward · · Score: 0

    I often use -D in combination with the FoxyProxy add-on for Firefox.
    Set up some nice URL filters to send some traffic through the SOCKS proxy, while other traffic just uses the default connection.
    No more switching back and forth Firefox's proxy settings.

  56. Bittorrent, anyone? by thoughtlover · · Score: 1

    Yes, it can be done. I read about it back in 2007. "Tunneling BitTorrent over SSH"

    --
    No sig for you! Come back one year!
  57. SSL SSH by nullspoon · · Score: 1

    I had a friend suggest to me something a ways back that I thought was pretty clever.

    If you're ssh'ing to your box for a proxy from say, work, you might not be able to get out since outbound connections might be disallowed by your company's firewall (or what have you). Even if outbound connections on 22 (or whatever oddball port you're running your ssh server on) are allowed, weird traffic like that might raise some eyebrows and get you in trouble.

    My friend's idea was to have ssh running on port 443 on your proxy box provided you don't have a web server using ssl running. Pretty much any firewall that has a website behind it has 80 and 443 open. In addition, 443 is ssl encrypted so when your encrypted ssh traffic goes through it, it hopefully won't raise much suspicion.

    --
    --
  58. Re:On the other hand, you could buy the book by abirdman · · Score: 1

    It's an excellent book-- short, concise, clear and nicely explained. Delivered by Amazon today. Thanks for the information.

    --
    Everything I've ever learned the hard way was based on a statistically invalid sample.