Linked by Thom Holwerda on Wed 5th Jul 2006 17:07 UTC, submitted by Borys Musielak
Internet & Networking "SSH is a program enabling secure access to remote filesystems. Not everyone is aware of other powerful SSH capabilities, such as passwordless login, automatic execution of commands on a remote system or even mounting a remote folder using SSH! In this article we'll cover these features and much more."
Order by: Score:
Sweet...
by tomcat on Wed 5th Jul 2006 17:52 UTC
tomcat
Member since:
2006-01-06

Really like RSA-key (aka password-less) login. Makes it much easier to implement automated stuff involving more than one machine.

Reply Score: 2

left off a couple favorites
by jamesd on Wed 5th Jul 2006 18:30 UTC
jamesd
Member since:
2006-01-17

The author has a nice list of tricks, I even learned a thing or two, like how mc (midnight commander handles fish and ssh protocols). My favorite ftp client lftp handles ftp, fish(sftp), and http protols and makes it easy to get and upload files to remote box.

You can find my list of favorite ssh tips at
uadmin.blogspot.com/2006/02/ssh-tips.html it includes how to access boxes behind a firewall, like they are on your own system. I even includes a script that automates logging into a box behind a firewall, using lftp, another trick it has, is if you need shell access, just shell out with "!", and type ssh 2200, and it will give you a full shell to the remote box, that is behind the firewall, not two steps like it would usually take to get to the box.

Gotta love the power of ssh.

Reply Score: 2

Useful, and not so useful
by WereCatf on Wed 5th Jul 2006 19:35 UTC
WereCatf
Member since:
2006-02-15

SSH is powerful, useful, and I couldn't live without it. I am constantly moving files between my machines over SSH, I do all the installing and administration usually over SSH, and I have already setup some automatic scripts on both machines to run over SSH when certain conditions are met. More specifically, NFS is faster than SSH, so I like to make the stuff available on PC1 available on PC2 over NFS, so PC2 checks on boot if PC1 is on, and mounts the NFS share. If PC1 is off, it will check on boot if PC2 is on, and mount the NFS share, using SSH and automatic login. Also, when PC1 is going down/rebooted, it checks again if PC2 is on, and unmounts the NFS share on it. This is just *so* useful.

Nautilus rocks when I gotta use SSH to manage files..

Reply Score: 0

v RE: Useful, and not so useful
by cozby on Wed 5th Jul 2006 21:35 UTC in reply to "Useful, and not so useful"
What ?
by Duffman on Wed 5th Jul 2006 20:06 UTC
Duffman
Member since:
2005-11-23

Which tricks ?
He is just using ssh just as every sysadmin every day.
All is described in the man page. Why reinvent the wheel ?

Reply Score: 1

RE: What ?
by Ford Prefect on Wed 5th Jul 2006 20:35 UTC in reply to "What ?"
Ford Prefect Member since:
2006-01-16

Not everybody is a sysadmin. Not everybody wants to learn from a man page. Nothing reinvented here.

Reply Score: 1

ryan
Member since:
2005-07-06

If you set up passwordless logins, anyone who gets ahold of your key can login to anywhere you've put as an authorized key -- this is a horrible security hole and should be highly discouraged.

What is FAR better is to use ssh-agent (or the windows equivilant peagant) to keep your passcode so you only have to input once -- this means you functionally have passwordless logins for your session after to type it in once, but you are still not hosed if someone steals your key.

This should be SSH 101, not some "tip" to undermine the security of the system you log into.

Reply Score: 5

theGrump Member since:
2005-11-11

agree, disabling passwords guts the security you are trying to create by using this tool in the first place. of course when this was mentioned on digg i was told i simply "had no clue".

Reply Score: 2

Endica Member since:
2006-07-07

Except you don't really disable any passwords. You just store a login key on your main computer for the other computer you want to remotely login to. As long as you have a good password for your main computer and store the key at a location that is only accessible by yourself (e.g. in your chmod'ed 700 home dir), the key is not at higher risk of being compromised than anything else in your home dir.

Edited 2006-07-07 09:18

Reply Score: 2

bogomipz Member since:
2005-07-11

Unless the file system is encrypted, chmod 700 isn't going to help once the wrong person gets physical access to your machine. For instance, if your laptop got stolen and had keys on it for imporant servers at work, the doors would be wide open.

The beauty of key pairs in such situation is of course that you can disable the key by simply removing it from authorized_keys (which is a good reason to not reuse keys for different machines), but do you really trust that you will not forget one of the hosts that accept this key, and are you sure you'll be able to clean up before anybody makes use of the key?

It's really not advisable to use plain text keys. You should always protect your private key with a passphrase. SSH-agent makes it almost as convenient as the non-encrypted option, although it clearly is more work to set up than just using normal password login. It's also more secure, though.

Reply Score: 1

v WOW!
by cozby on Wed 5th Jul 2006 21:33 UTC
derekmorr
Member since:
2005-09-25

There's a new SSH standard for using Kerberos for host and user authentication. It's called gssapi-keyexchange. With it, you don't need to manage ssh-specific host kets and known_hosts files, which can be a real win for very large sites. It's a shame the author didn't mention it.

Reply Score: 1

cool
by deanlinkous on Wed 5th Jul 2006 22:48 UTC
deanlinkous
Member since:
2006-06-19

interesting article...
nothing amazingly new but certainly something that not everyone is familar with...

Reply Score: 1

Tar pipe
by Tyr. on Thu 6th Jul 2006 00:13 UTC
Tyr.
Member since:
2005-07-06

An oldy that I use alot is the tar pipe over ssh. Eg. :

$ tar cf - /home/myuser | compress -c | ssh user@host " ( uncompress -c | tar xvf - ) "

Surprised not to see it mentioned.

Reply Score: 3

RE: Tar pipe
by gilboa on Thu 6th Jul 2006 05:59 UTC in reply to "Tar pipe"
gilboa Member since:
2005-07-06

... I assume it is faster then normal every day "scp -C", right?

BTW, why not use gzip and/or bzip2 for compression?

Reply Score: 1

RE[2]: Tar pipe
by Tyr. on Thu 6th Jul 2006 16:44 UTC in reply to "RE: Tar pipe"
Tyr. Member since:
2005-07-06

... I assume it is faster then normal every day "scp -C", right?

BTW, why not use gzip and/or bzip2 for compression?


It's faster and you can throw sudo's in there to copy files you don't own if needed. Gzip isn't installed on every unix, it certainly isn't on our reduced DMZ builds. It's also more flexible : you can only copy a predefined list of files, or use find to pipe a list of files into the tar. It also has the added bonus of confusing those new to unix ;-)

Reply Score: 1

more applications
by tbostick78 on Thu 6th Jul 2006 01:19 UTC
tbostick78
Member since:
2005-12-16

Numerous other apps can use SSH. I use svn for version control over ssh with password-less auth. Rsync is another big one -- excellent for transfering a whole website to the host securely. And, rsync only transfers modified files, which makes the whole process of updating a huge site secure and painless.

svn co svn+ssh://repo/module
svn commit # and svn commits over ssh tunnel

rsync -e ssh src [user@host:]dest

Reply Score: 1

RE: Tar pipe
by phoenix on Thu 6th Jul 2006 01:43 UTC
phoenix
Member since:
2005-07-11

Why the extra pipes with compress? Just add -j (BZip2) or -z (GZip) to the tar command to do the compression/uncompression automatically in one go.

Reply Score: 1

RE[2]: Tar pipe
by taos on Thu 6th Jul 2006 02:27 UTC in reply to "RE: Tar pipe"
taos Member since:
2005-11-16

Not every *nix' tar command supports -j or -z for compression.

Reply Score: 2

Soulbender
Member since:
2005-08-18

"It's a shame the author didn't mention it."

Maybe he didn't want to write a 5000 word essay on how to configure kerberos.

Reply Score: 4

Wtf?
by Soulbender on Thu 6th Jul 2006 03:13 UTC
Soulbender
Member since:
2005-08-18

"When the program asks for the key password, we should just press ENTER - this way, a passwordless key will be created."

This is such bad advice it hurts my brain. Hasn't this guy heard of ssh-agent?

Reply Score: 2

uh
by deanlinkous on Thu 6th Jul 2006 03:28 UTC
deanlinkous
Member since:
2006-06-19

maybe he is using ssh only on his local network where a password isnt needed? maybe???

Reply Score: 1

SSHFS perfect for wireless networks
by djst on Thu 6th Jul 2006 06:38 UTC
djst
Member since:
2005-08-07

Using SSHFS in a wireless local network is a lot more secure than NFS or Samba shares. Couple it with ssh-agent and you get hassle-free and very secure file sharing between your computers in the network.

Except for one minor issue I've had: For some reason, SSHFS crashes and sometimes even makes the whole system crash. At least if you're running Ubuntu (tested in Hoary, Breezy and Dapper). I've tried it with several machines and it's always the same thing. When you unmount shares, it says "Segmentation fault" and sometimes the graphics in your X session gets garbled and the whole system crashes. If anyone knows what's wrong, any advice would be much appreciated.

Reply Score: 1

Suft on public areas for free!
by djst on Thu 6th Jul 2006 06:42 UTC
djst
Member since:
2005-08-07

I must share a tip I'm using daily. Commuting to work, I sometimes need to spend half an hour waiting for a train on a public train station. They have a wireless Internet connection you may use if you pay for it. However, by changing the SSH port on my server to e.g. 7722, I can now connect to it using 'ssh -p 7722 my.server.com' and use the Internet connection for free! I know, it may not be perfectly legal, but in my opinion they should blame themselves for not disabling the traffic on the port.

Anyway, if you often spent time on public paid-for wireless spots, go ahead and try it out!

Reply Score: 1

RE: uh
by Soulbender on Thu 6th Jul 2006 06:47 UTC
Soulbender
Member since:
2005-08-18

"maybe he is using ssh only on his local network where a password isnt needed? maybe???"

That's no excuse for teaching bad and insecure habits.

Reply Score: 1

RE[2]: uh
by deanlinkous on Thu 6th Jul 2006 15:05 UTC in reply to "RE: uh"
deanlinkous Member since:
2006-06-19

picking your nose is a bad habit....nothing wrong with doing it at home though!

no password SSH is a bad habit...nothing wrong with doing it at home though!

a little bit of warning in the article would of been good - sort of like your mother telling you to not pick your nose in public maybe! ;)

Reply Score: 1

RE[3]: uh
by Soulbender on Fri 7th Jul 2006 02:54 UTC
Soulbender
Member since:
2005-08-18

"picking your nose is a bad habit....nothing wrong with doing it at home though!"

Noone's actively trying to teach you to pick your nose though.

Reply Score: 1