SSH beyond the command line

File servers made easy with SSH

Download the whole article as PDF

Short URL: http://fsmsh.com/2358

Write a full post in response to this!


If you’re an experienced administrator, you’ve probably used SSH to remotely access a troublesome box or your personal computer. For those who don’t know: SSH it’s a great way to fiddle with a computer from miles away as if you were sitting at its keyboard, but it’s also just about the simplest and most secure way to configure your computer to let you access its files from anywhere. You can use SSH on nearly every operating system to transfer files to and from your computer over the internet or a LAN.

Is SSH for more than commands?

SSH is traditionally used to give you remote access to a computer’s shell (command line terminal). Earlier protocols in this vein, such as telnet and rlogin, did not encrypt their traffic or take other security precautions that are necessary with untrusted networks like the internet. Depending upon the exact server, protocol, and configuration you use, SSH may be the most secure way to access a computer over a network.

If you’re a typical user, however, you may never need to access the command line—or even graphical applications—on a remote computer. Even so, SSH will still be useful in sending your latest batch of photos home from your hotel, retrieving the latest version of a report left sitting on your desktop, or for any other situation requiring a file transfer.

If you’d like to get more in depth, you can use it to load or edit a spreadsheet on another computer or keep documents synchronized between machines. If you’ve seen an experienced user work his magic with SSH, all of this may seem rather complicated. I assure you, though, that setting up an SSH server on GNU/Linux or another Unix-like operating system—and even Microsoft Windows—is as simple as installing any other software, and accessing your server from another machine running nearly any OS is even easier.

Setting up an SSH server is as simple as installing any other software, and accessing your server from another machine is even easier

Installing the server

The SSH protocol has been around for a while and several server packages have sprung up around it. The choice is a bit simpler than KDE vs GNOME, though, because almost everyone you meet will recommend OpenSSH. It’s tried, true, secure, free software developed by the OpenBSD project but made available for nearly every operating system under the sun.

If you’re using a Unix-like system such as GNU/Linux, installation really is as simple as for any other software. If your distribution has a package management utility, OpenSSH is undoubtedly available from it. In Debian and Ubuntu, it’s listed as “openssh-server”. If you normally have to install software from source, you can get the code from the OpenSSH website.

Unfortunately, things are a bit more complicated if you use Windows. You will need to use some software called Cygwin to emulate the GNU/Linux platform on your Windows box. If you are already familiar with Cygwin, you can install OpenSSH as a native package.

Wait, though! If you don’t use Cygwin already—wouldn’t you know it—someone has gone and made the whole process just as easy. The OpenSSH for Windows project has combined OpenSSH with only the absolutely necessary components of Cygwin, rolled it all up into a ball, and released it as free software on Sourceforge. Download and double click the “binary installer” as you would any other Windows setup package.

Some minor tweaking, if desired

Below, I will explore some of the configuration options of OpenSSH. Odds are your distribution has your server setup more or less like this by default, so you may safely skip this section and refer back later on if you experience problems.

OpenSSH for Windows users must also depart from the article here, as configuration on that platform works a little differently. You can refer to the README file, accessible from Start→All Programs→OpenSSH for Windows for configuration instructions. In particular, make sure to setup user passwords using the simple instructions in the readme.

For those continuing on, OpenSSH configuration can easily be done by editing a configuration file (never as scary as it sounds). On most systems, this file will be located at /etc/ssh/sshd_config. Open this file as the root user using your favorite text editor and you will find that your distribution has supplied a long template configuration file.

OpenSSH has a broad range of configuration options that can have serious effects on the security of your system. I will trust that the default settings provided by your distribution are sensible and focus on changing the configuration to serve the specific requirements of file transfer.

You could debate whether a password is more secure than other methods of authentication, but it is undeniably convenient

Password authentication

First, you can configure the SSH server to authenticate users with a password. You could debate whether a password is more secure than other methods of authentication, but it is very convenient when trying to access your machine from an arbitrary remote location where you might not have access to anything but your memory. Make sure the following line is set in your configuration file:

PasswordAuthentication yes

Remember that any line in the configuration file beginning with # is a comment, so delete the hash mark if you want to activate the line.

Don't miss out on the other pages!
123next ›last »

Write a full post in response to this!

0

Do you like this post?
Vote for it!

Copyright information

Verbatim copying and distribution of this entire article is permitted in any medium without royalty provided this notice is preserved.

Biography

Nathan Sanders: Nathan Sanders is an experienced free-software user and frequent contributor to publications concerning open-source software.

Andrew Min's picture

Great article!

Submitted by Andrew Min on Mon, 2007-08-06 21:13.

Vote!
0

Love it! Informative, easy-to-use, and includes instructions for KDE as well as Gnome! Looking forward to the next article.

--
Andrew Min
http://andrew.timstown.net/dock.htm

ukh's picture

Nautilus is annoying

Submitted by ukh on Tue, 2007-08-07 13:55.

Vote!
0

Thanks for a nice article!

I find going through Nautilus annoying since, at least in my environment, it defaults to the root, rather than my home directory. For those needing a GUI frontend in Gtk+ that doesn't involve digging for your $HOME, I'd suggest looking at gFTP, http://www.gftp.org/.

FOSS SFTP frontends on Mac OS X include Fugu, http://rsug.itd.umich.edu/software/fugu/ and Cyberduck http://cyberduck.ch/.

Also, being a GPL SFTP client on Windows, I think FileZilla, http://filezilla.sourceforge.net/, deserves to be mentioned.

undefined's picture

nautilus secondary, gnomevfs primary

Submitted by undefined on Wed, 2007-09-26 15:18.

Vote!
0

the benefit to ssh-gnome integration (gnomevfs) is not necessarily nautilus supporting ssh, but most (all?) gnome applications supporting ssh.

correct me if i'm wrong (it might have been smb, not ssh, that i recently exercised, but i've done something similar with ssh-access under gnome), but recently my wife needed to edit a document (not a plain text file) on a remote server with openoffice. it just worked. later we needed to open a remote file with a non-gnome application which required copying the file locally with nautilus, editing it, and copying it back. my wife didn't care for the multi-step process.

so yeah, though nautilus might not be the best ssh/sftp/scp client, it's just the tip of the gnomevfs iceberg.

(btw, to be desktop-agnostic, kde w/ kio slaves is smiliar, if not identical.)

undefined's picture

ssh, windows, cygwin

Submitted by undefined on Wed, 2007-09-26 12:34.

Vote!
0

first, "openssh for windows" appears to be unmaintained with no releases since 2004 and with a statement claiming such on http://www.openssh.com/windows.html. i don't recommend unmaintained security software. that page lists an alternative: copSSH. not that i care much for cygwin, especially application-specific cygwin installations, as it was (is?) troublesome (cygwin applications interact poorly with cmd, native applications interact poorly with bash, different versions of cygwin dll conflict with one another due to versioning of shared memory, etc) and slower than native. granted, my experience is dated (2004), but was extensive at the time, and i finally gave up in frustration and decided "when in rome, do as the romans".

second, i never found ssh to be that useful on windows. most (all) meaningful windows applications require a gui which means rdp. for administration, windows is nearly impossible to interactively administrate without the control panel and mmc. just about every windows application installer assumes a gui, too. yes, there are ways to administrate and install without a gui, but if you are "in bed" that much with windows, you're probably using wsus, login scripts, psexec, etc. for file transfers? never had that big of a need as i usually tunnel to a linux box and get it by way of that machine (port forwarding vnc and/or rdp, remote x-windows file manager, or just smbfs).

thirdly, "run GUI GNU/Linux applications remotely on a Microsoft Windows host"? xming?

skypjack's picture

Good

Submitted by skypjack on Wed, 2007-09-26 13:40.

Vote!
0

Really an easy-to-use, good article!
Thanks so much ...

Chris G.'s picture

That's too much work!

Submitted by Chris G. (not verified) on Wed, 2007-09-26 14:48.

Vote!
0

This is an overly complicated process that can be solved with two small, simple, and free programs:
1) Simon Tatham's PuTTY (http://www.chiark.greenend.org.uk/~sgtatham/putty/)
2) FileZilla (http://filezilla-project.org/)

FileZilla has some notable features (quoted here from their site):
* Easy to use
* Supports FTP, FTP over SSL/TLS (FTPS) and SSH File Transfer Protocol (SFTP)
* Cross-platform. Runs on Windows, Linux, *BSD, OSX and more
* Available in many languages
* Supports resume and transfer of large files >4GB
* Powerful Site Manager and transfer queue
* Drag & drop support
* Configurable Speed limits
* Filename filters
* Network configuration wizard

My organization manages over 8000 machines and have found FileZilla so useful and simple, we have replaced the aging WS_FTP with it in our base image. PuTTY is also part of our base image. Why? Because it's free, simple and versatile. If you like command lines, then it also has utilities to work from the command line, especially for SCP.

As I stated in the subject line, this article is too much work for the benefit. Use easier, supported solutions.

undefined's picture

work? windows was brief

Submitted by undefined on Thu, 2007-09-27 04:14.

Vote!
0

overly complicated process? solved with two small, simple, and free programs?

you seemed to have forgotten about the server? half of the article (1.5 pages) was about configuring sshd, but without that "work" and "complicated process" your clients are useless.

and the rest of the article was about linux: openssh's scp, gnome's nautilus, and kde's konqueror. oh yeah, there was an itty-bitty bit about windows (which you are definitely coming from with comments about putty & ws_ftp).

so the relatively small mention of windows support, really only winscp, is "too much work" and part of "an overly complicated process"? yeah, introducing TWO applications (filezilla & putty) is so much easier and simpler than just one (winscp).

anyways, i think the article is laid out well and progresses logically:
- intro
- sshd configuration (because ssh requires a server and configuration is important for security)
- scp (the original, basic, & default file client for ssh)
- nautilus (gnome integration)
- konqueror (kde integration)
- winscp (windows-specific client)

i may question the utility of sshd on windows, but that's a very small part of the article, and i wouldn't make general comments about the whole article based on that one paragraph.

mind's picture

sshfs

Submitted by mind (not verified) on Wed, 2007-09-26 18:05.

Vote!
0

no need for gnome vfs or kde proprietary filesystem wrapper paths. fuse is in the kernel, and sshfs is in my apt tree on ubuntu.

% sudo apt-get install sshfs
% sshfs server: ~/remote

will mount your home directory on server under ~/remote on the local machine, using only the sftp server on the remote end.

Anonymous visitor's picture

SSH commands for memory and cpu ?

Submitted by Anonymous visitor (not verified) on Sat, 2007-09-29 02:28.

Vote!
0

Hello Nathan and Hello World,

I'm new to ssh and want to ask you a question:

I have signed up for a dedicated server.
Now I want to check if the memory really is 2 GB
and that the cpu really is a pentium 4 and not a celeron.
Do you know the ssh commands for that?
Maybe diskspace and bandwidth can be checked also?

CuteFTP Pro seems to handle ssh: www.globalscape.com
It should be debian, similar to freeBSD installed on an apache server.

Thanks a lot,

Customer911

Anonymous visitor's picture

assuming it's a linux

Submitted by Anonymous visitor (not verified) on Tue, 2007-10-09 22:54.

Vote!
0

assuming it's a linux machine, log on your server and run these commands:

cat /proc/cpuinfo
and
cat /proc/meminfo
and
df -h

checking bandwidth would be tricky, but you can keep an eye on
cat /proc/net/dev
to monitor how much data is going through your network interface...

[]'s

Grant McLean's picture

Linux GUI tool for SSH

Submitted by Grant McLean (not verified) on Wed, 2007-10-03 22:29.

Vote!
0

Shameless plug ... Linux users looking for a GUI tool to manage their SSH connections should check out SSHMenu: http://sshmenu.sourceforge.net/

Anonymous visitor's picture

personally i can't imagine my daily work without ssh

Submitted by Anonymous visitor (not verified) on Tue, 2007-10-09 22:49.

Vote!
0

and let's not forget about beautiful multimedia streaming over ssh with elegant commands like:

ssh xoxota cat /data/1/mp3/ChicoBuarque/O_Grande_Circo_Mistico/08-Ciranda_da_bailarina.mp3 | mpg321 -

( where i log on my remote machine "xoxota", and execute a "cat" of a file, piping it to the mp3 player "mpg321" running locally on my laptop )



Two fantastic free software companies that make Free Software Magazine possible:

Other sites

Odiogo