Server User Manual

From Extremely Corporate Wiki
Jump to navigation Jump to search


If you have a user account on the server, there are a few things you should probably know. This is meant to be the place for those sorts of things.

Getting started

The server is a Linux system. If you're clueless, Linux Journey is a good resource to learn the basics of navigation and editing from a command line environment.

The ssh command to log into the server is a bit long due to the long hostname + non-standard port, so you may want to add the following to your ssh config file (which is probably at ~/.ssh/config):

Host ec:
    HostName extremelycorporate.ca
    Port 1222
    User username

After doing this, you can log into the server with ssh ec.

Your user account will have been bootstrapped by an administrator. If you want to give another computer access to your account, append its SSH public key to ~/.ssh/authorized_keys and make sure you do not disturb any of the previous contents.

Using your Files

You may also want to mount your home directory (or any directory) locally on your computer. This can be achieved with SSHFS (DigitalOcean guide to installing SSHFS on various platforms). After adding ec as a host to your SSH config, you can mount your home directory to a local directory with the following steps:

  1. Create the directory on your local computer where you want to be able to access your files and make sure it's empty.
  2. Run sshfs ec:. path/to/local/folder, but with the actual path to where you want your files mounted on your computer.
  3. ????
  4. profit.

You can also use SFTP instead of SSHFS. On Linux, most file managers will let you enter sftp://ec as a file path in order to access the server's files. On Windows, you can use FileZilla (open source, cross-platform) or WinSCP (free and open source, only works on windows). On MacOS, you can use FileZilla or Transmit (proprietary, costs $30).

Available Programs

Editors

  • NeoVim (command: nvim or vim) (guide)
    A powerful text editor that takes some getting used to.
  • GNU Nano (command: nano) (guide)
    A simple editor you can use if you don't want to use Vim.

File Managers

  • Ranger (command: ranger) (guide)
  • LF (command: lf) (guide)

Multiplexers

  • Tmux (command: tmux) (guide)
    To start Tmux, run tmux. You can then split your terminal session into panes. Press CTRL-b and then either " or %.
    " will insert a new pane below the current pane.
    % will insert a new pane to the right of the current pane.
    You can navigate between panes by pressing CTRL-b and then using the arrow keys. You can resize panes by pressing CTRL-b, holding CTRL and then pressing the arrow keys to resize in that direction. You can move panes by pressing CTRL-b and then pressing { to move the current pane left or } to move the current pane right. You can also navigate and resize panes using the mouse. You can click on a pane to select it or click and drag on the border between panes to resize. Support for this feature may vary depending on your terminal emulator, but the keyboard shortcuts outlined above will always work. For more advanced usage, please see the attached guide. You can also use Tmux to share your terminal session with another user logged into the server. You can do this by first running tmux -S /tmp/session_name new -s session_name. This starts a new session which is accessible over the socket at /tmp/session_name. After the session is created, change its permissions such that other users can access it (chmod 777 /tmp/session_name will make it accessible to everyone). Another user can now join your session by running tmux -S /tmp/session_name a -t session_name. Users can leave the session by pressing CTRL-b and then d.
  • GNU Screen (command: screen) (guide)
    The main reason GNU Screen is installed is for simple terminal session sharing. This is possible with Tmux, but it's simpler with Screen. To start a sharable session, run screen -S session-name then press CTRL-a and type :multiuser on followed by pressing CTRL-a again and typing :acladd username where username is the user you want to grant access to your session. To join a session, run screen -x session-name. For example, user A might start a session with screen -S cool_club and user B can join it with screen -x cool_club.

Wacky Ways to Annoy Other Users™

The write Command

Run who to see a list of logged in users. Example output:

 14:30:54 up 3 days, 14:34,  1 user,  load average: 0.39, 0.93, 1.18
USER     TTY        LOGIN@   IDLE   JCPU   PCPU WHAT
bob      tty1      Mon16   32:28m  1:30m  0.00s bash

The important things to notice are the user name and the TTY. You can write a message to a user by running write user ttyname. To message "bob" from the above example, you would run write bob tty1. This will open a prompt where every line of text you write is sent to the user targeted. You can exit this prompt by pressing CTRL-c

The wall Command

You can send a single banner-style message to every user with the wall command. The command is used as wall message. For example, to send everyone a message that reads "Hello, losers" you would run wall "Hello, losers". When you do this, you will also be able to see the message you sent.

Defending Yourself

You can control whether or not you see messages sent via the above methods with the mesg utility. Run mesg n to block messages. Run mesg y to allow messages.

User Website

The server is set up to host a webpage out of each user's home directory. The simplest possible setup is to create an index.html file at ~/www/index.html. You can get started by running cd && mkdir www ; nano index.html. You can save and exit from GNU Nano by pressing CTRL-x. Finally, make sure the ~/www/ directory is readable by others (you can do this by running chmod -R o+r ~/www). After doing this, your website will be reachable at

https://extremelycorporate.ca/~your-username

User Gemini Capsule

The server is also set up to serve a gemini capsule out of each user's home directory. Just create the ~/gemini directory and put your content in there. Make sure your ~/gemini directory is readable by everyone by running chmod o+r ~/gemini. Your gemini capsule will be reachable at

gemini://extremelycorporate.ca/~your-username