Java Reference
In-Depth Information
Before you panic over all these different bundles, realize one very important
and comforting thing: the command-line shell,
bash
, works the same on each
and every one of these distributions. All the commands we've used in this
topic, such as
ls
,
cp
, and
cd
, all work exactly the same no matter which Linux
flavor you choose.
Ubuntu and CentOS seem to be the most common server distributions at the
moment. Most VPS services will let you choose which distribution you want
from a small selection of offerings.
The biggest difference you'll run into from one distribution to another is their
package management: what tool you use to install software packages, and
what packages are included by default.
Remote Access
To log in to your remote server's command-line shell, you need to use a set
of programs known as SSH (which stands for “secure shell”).
ssh
is the com-
mand you run to connect to the server; it's the client. The server is running
sshd
(for “ssh daemon”), and that's what you connect to. Your server might
already be running an
sshd
. We'll get to that shortly.
You can use
ssh
to connect to a server, and its companion program,
scp
, to
copy files to the server (
scp
works a lot like plain
cp
).
ssh
just needs to know the user name and server name or IP address you're
connecting to, which you can specify like an email address, using the “@”
sign:
$
ssh andy@example.com
Password:
Or if you don't have a name yet, you can connect using the IP address:
$
ssh andy@93.184.216.119
Password:
You may have been given an account name to use already, or you may need
to make one using the web interface from your VPS provider.
You use the same sort of notation with
scp
to copy a file. Here we're copying
a local text file named
myfile.txt
up to the server
example.com
, logging in as
andy
,
and copying the file to my home directory (“
~/
”).
$
scp myfile.txt andy@example.com:~/myfile.txt
Password:
(Again, you could also just use the IP, as in andy@93.184.216.119.)