Live data from Hacker News

SSH Examples, Tips and Tunnels

hackertarget.com

11–20 of 72 posts

Re: SSH Examples, Tips and Tunnels

#12
post #9
post #2

> localhost:~$ ssh remoteserver "cat /var/log/nginx/access.log" | grep badstuff.php It would be much more traffic (and execution time) friendly, if you put pipe and grep to "" as well, so grep would be executed on remote server and ssh won't have to send the entire log to your machine. And I'd like to highlight the overwhelming awesomeness of ~/.ssh/config file. If you haven't heard about it or use shell alias instea…

> .ssh/config Do you mean this or something not described there? https://nerderati.com/2011/03/17/simplify-your-life-with-an-...

Yes, exactly this.

Re: SSH Examples, Tips and Tunnels

#14
post #8
post #7

Earlier quoted context omitted.

This is interesting. I sometimes have to connect to a VPN that crashes when something provokes a burst of activity (if I cat a file or even ls a large dir). I'll try this, but 576 seems so low; how did you get at this number?

This is what I want to know - the article doesn't explain. I guess its a number that particular (old?) routers / particular firewalls won't fragment the packet..?

Wikipedia says 576 is the minimum for IPv4. I suppose then that the author just went for the value all hosts should support.

Re: SSH Examples, Tips and Tunnels

#15
If you liked this article, PLEASE, PLEASE just take 10 minutes to look at the manpages for ssh(1) and ssh_config(5). SSH options are nothing we need to research about, we humans made it and we wrote documentation for it. The manpages are also exhaustive, definitive, and valid for the exact version you have installed.

Please, instead of making more 'how to use SSH'-articles popular, read the manpages yourself.

Reading the datasheets and documentation of the stuff you work with is an important characteristic of an capable engineer.

Re: SSH Examples, Tips and Tunnels

#16

If you liked this article, PLEASE, PLEASE just take 10 minutes to look at the manpages for ssh(1) and ssh_config(5). SSH options are nothing we need to research about, we humans made it and we wrote documentation for it. The manpages are also exhaustive, definitive, and valid for the exact version you have installed. Please, instead of making more 'how to use SSH'-articles popular, read the manpages yourself. Reading…

Do you want to get rid of how-tos? Both references and how-tos are needed. They serve different purposes.

Re: SSH Examples, Tips and Tunnels

#17

If you liked this article, PLEASE, PLEASE just take 10 minutes to look at the manpages for ssh(1) and ssh_config(5). SSH options are nothing we need to research about, we humans made it and we wrote documentation for it. The manpages are also exhaustive, definitive, and valid for the exact version you have installed. Please, instead of making more 'how to use SSH'-articles popular, read the manpages yourself. Reading…

> Reading the datasheets and documentation of the stuff you work with is an important characteristic of an capable engineer.

I completely agree with this statement, but that doesn't nullify the value of "how to use x" articles. Man-pages are great because:

- they're (mostly) ubiquitous

- they're plaintext, meaning their format is more robust and accessible (e.g. I can read man over SSH without ever encountering issues)

and these are great pros, but in certain relevant aspects they're grossly inferior to articles like this:

- man-pages must be exhaustive, and thus don't have the luxury of focusing on the most common use-cases up front. These are often relegated to the "Examples" section only, or omitted altogether

- screenshots. Even for terminal apps, screenshots are incredibly helpful, and in this particular article they're also used to demonstrate the use of applications your SSH connection will interact with (e.g. browser proxy/network settings)

- (related to the above) contextual information that would otherwise be off-topic/inappropriate in a man-page. How-to articles can cover multiple apps that interact with eachother as one topic; i.e. a how-to article can focus on a use case rather than a single app.

Re: SSH Examples, Tips and Tunnels

#18

If you liked this article, PLEASE, PLEASE just take 10 minutes to look at the manpages for ssh(1) and ssh_config(5). SSH options are nothing we need to research about, we humans made it and we wrote documentation for it. The manpages are also exhaustive, definitive, and valid for the exact version you have installed. Please, instead of making more 'how to use SSH'-articles popular, read the manpages yourself. Reading…

While your point is valid it applies to a single tool. Often the combination of multiple tools and Unix knowledge is what provides a simple solution to common problems. Not everybody has the broad knowledge to come up with these themselves so tutorial articles are a valid and helpful complement to man pages in my point of view.

Re: SSH Examples, Tips and Tunnels

#19
post #6
post #2

> localhost:~$ ssh remoteserver "cat /var/log/nginx/access.log" | grep badstuff.php It would be much more traffic (and execution time) friendly, if you put pipe and grep to "" as well, so grep would be executed on remote server and ssh won't have to send the entire log to your machine. And I'd like to highlight the overwhelming awesomeness of ~/.ssh/config file. If you haven't heard about it or use shell alias instea…

The article does touch on that optimization: In this example the grep is being performed on the local system after the log file has been pushed across the ssh session. If the file is large it would be more efficient to run the grep on the remote side simply by enclosing the pipe and grep in the double quotes.

I see no benefit of running grep locally in any case unless maybe local grep is aliased in a complex way to colorize and decorate the outputs in some other way.

Either way this is not a great example as you should just login and run it on the remote machine as running through pipe causes the connection to be established every time unless you keep a persistent connection open behind which is explained in the MultiPlex section which is very handy when you need to run many commands over ssh in cases of like taking backups from that machine.

Re: SSH Examples, Tips and Tunnels

#20
Is there a way to combine screen/tmux with ssh ? like i always need to do some long running tasks over ssh and forget to put it in a screen session, i would like to open each ssh session in a screen session so that when i connect next i should be able to proceed from where i left
Post reply on HN