[sf-lug] How do I log in?

Michael Paoli Michael.Paoli at cal.berkeley.edu
Tue Apr 14 01:03:40 PDT 2020


[Bcc: a user]
> Date: Mon, 13 Apr 2020 23:52:18 -0700

> How do I log in? I need more details please.

Ah, I get questions ...

So, how does one login to a Linux host?
Typically that's done with a user/login name, and password (at least
often initially ... though sometimes an ssh key, or physical access
is used).

So, in the typical case, one uses a ssh(1) client.
Many common operating systems (e.g. Linux/Unix/BSD/MacOS) come with
one, or have such readily available - typically as the ssh command
from the Command Line Interface (CLI), e.g. a terminal window(/emulator),
or console.  So, if I show typical command, with leading "$ " as customary
user prompt (shell PS1):, it would look something like this:
$ ssh login at host
or:
$ ssh -l login host
Where login is one's login/user name, and host is the name of the host,
resolved through any of, e.g. DNS, /etc/hosts, ~/.ssh/config,
or giving an IP address (the latter not generally recommended, but
can be used - IP addresses - not as friendly for the humans, and may
also be more likely subject to change).
Also, for better security, one can generally add the options a and x, e.g.:
$ ssh -ax login at host
or:
$ ssh -ax -l login host
Or one can effectively default to having those options set by one's
~/.ssh/config file, or they may default that way on the system (that would
be the more secure default, and typically the case ... I, mostly out of
security habit, generally explicitly give the -ax options, as then they're
active regardless of any other bits or other defaults).

That's basically it.  If one uses password authentication, one will be
prompted for password.
Often the case with a new account, or a password reset, one will be
forced to pick a new password.
It may or may not - but typically, asks for the old/existing/current
password one more time (generally the passwd(1) program doing that -
it having taken over at that point),
and then the new password - twice (since it doesn't echo it - to forestall
typing mistakes, and make it much more probable the user set the password
to what they think they set it to).
That's pretty much it.  (In the case of forced password change, it will
generally disconnect one after the password is changed - and then one
can do the ssh again and login with the new password).
Once one's logged in, one is typically greeted with a prompt such as:
$
Congratulations, one has just logged in!

Depending on the system/configuration, the prompt may be different (most
Linux distros default to having a longer more informative prompt).
The system might also greet one with some additional line(s) of information
before displaying the prompt (e.g. contents of /etc/issue and/or /etc/motd).
Sometimes the prompt might even be multi-line (but that's generally
wasteful of a lot of space and typically annoying ... so not done as
commonly).

What if there isn't an ssh client installed on the operating system?
For Linux/BSD/Unix, ssh is generally readily available - if not already
installed, available to be installed.
Microsoft Windows?  Uhm, yeah, that.  Still no ssh client by default.
One that many/most people use in such circumstance, and is quite good,
and free (at least as in beer - not sure about source) is PuTTY - see
https://www.putty.org/
Yes, Graphical User Interface (GUI) - as in ewey GUI.
Though PuTTY also provides CLI.
PuTTY's CLI and command is relatively similar to typical ssh(1), but
definitely not the same or nearly as full featured and capable as ssh(1),
but can still be pretty useful for doing ssh CLI stuff from
Microsoft Windows.
And PuTTY's GUI is pretty dang good as far as GUIs go.  And its
terminal emulation is quite excellent (so good there's also separately
packaged software of just that portion thereof).
I'm not here to do a tutorial on PuTTY ... besides, if one wants
a GUI ssh client for Microsoft Windows, there are lots of them
to choose from - of varying quality and price (and those factors
not necessarily correlating).

Oh, and for the BALUG Virtual Machine (VM) ... host:
balug-sf-lug-v2.balug.org
... yes, I know, rather funky, odd, and long.  But there's a particular
set of reasons and history behind that.  Don't want to type/remember
that?  Configure your ssh client accordingly - e.g. for ssh(1),
can put another name (e.g. BALUG) in ~/.ssh/config that one can use,
then just give that other name as host, and ssh, via ~/.ssh/config will
then automagically use, for that other name provided, the actual host name of
balug-sf-lug-v2.balug.org
See also: ssh_config(5)

Oh, also, ... -l login, or login@ -
if it so happens on the client side, one's local login/user name is the
same as that for the target server, one can omit that bit, as it will
by default use the local login/user name for the targeted server.
"Of course" one can also configure that in ~/.ssh/config, so for the
specified target (or more generally), one could have it default to
a configured login name - and thus save having to type that login portion
most of the time.




More information about the sf-lug mailing list