Difference between revisions of "Shell account tutorial"
imported>Mjh |
imported>Echarlie (→Troubleshooting) |
||
(21 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
− | This | + | This Provides a summary of basic SSH usage on acidburn, with notes for ECE 2524 students as well. In the future, these will be separated into two pages. |
+ | One advantage of a shell account is that it allows one to leave an IRC client constantly connected, eliminate join/quit spam, and | ||
+ | log missed messages to check later. In order to accomplish this, the IRC client must be run inside either [[tmux]] or [[screen]] so that | ||
+ | it will not be killed when you disconnect from SSH. | ||
− | The [[gp:Bradley Department of Electrical and Computer Engineering|ECE]] department offers shell ccounts on the [[gp:CAD and Visualization Laboratory|CVL]] for Virginia Tech affiliates. Accounts can be created at [http://computing.ece.vt.edu/accounts/ this page]. | + | == CVL SSH accounts == |
+ | The [[gp:Bradley Department of Electrical and Computer Engineering|ECE]] department offers shell ccounts on the [[gp:CAD and Visualization Laboratory|CVL]] | ||
+ | for Virginia Tech affiliates. Accounts can be created at [http://computing.ece.vt.edu/accounts/ this page]. | ||
− | The ECE2524 VM (128.173.88.125) can be accessed via SSH for CVL users, and has tmux, mosh, and weechat installed | + | The ECE2524 VM (128.173.88.125) can be accessed via SSH for CVL users, and has tmux, mosh, and weechat installed. The |
+ | [[gp:CAD and Visualization Laboratory|CVL]] is also useful for general computing (e.g. [[MATLAB]]). | ||
− | + | == Acidburn == | |
+ | |||
+ | Acidburn (acidburn.vtluug.org), the VTLUUG shell server, has a few more IRC clients installed, as well as other software and <s>full</s> partial IPv6 support. Because of new restrictions on SSH access (all of port 22 is blocked for off-campus users, although we ''shouldn't'' be blocked), Acidburn can be accessed at port 2222. | ||
+ | |||
+ | We strongly recommend setting permissions of '''all''' files on your acidburn home directory to 600, except for a public_html/ directory. | ||
+ | |||
+ | == Basic Usage == | ||
Here's the procedure for using either the ECE2524 server or acidburn for IRC: | Here's the procedure for using either the ECE2524 server or acidburn for IRC: | ||
Line 21: | Line 33: | ||
#* <code>^b-d</code> (that is, press Control-b, then d) | #* <code>^b-d</code> (that is, press Control-b, then d) | ||
#* ''Use this whenever you are inside a tmux window and wish to return to a shell'' | #* ''Use this whenever you are inside a tmux window and wish to return to a shell'' | ||
− | # To, reattach to the first tmux seesion, just use <code>tmux | + | # To, reattach to the first tmux seesion, just use <code>tmux attach</code> |
− | #* <code>user@ece2524:~$ tmux attach</code>. | + | #* <code>user@ece2524:~$ tmux attach -d</code>. |
#* ''On subsequent logins, this should be the only command you need to execute to return to IRC'' | #* ''On subsequent logins, this should be the only command you need to execute to return to IRC'' | ||
− | + | '''If you have been given a temporary password please reset it by running | |
+ | <code>$ passwd</code>''' | ||
− | [http://mosh.mit.edu Mosh] is another helpful tool you may want to use for high-latency or mobile (e.g. wifi) connections. You also may want to look into zsh, an alternative to bash with more features. | + | ==Other SSH Suggestions== |
+ | * Use [https://wiki.archlinux.org/index.php/SSH_keys SSH Keys] | ||
+ | * Write up your own [[tmux|tmux.conf]] | ||
+ | * Use X-forwarding on servers that support it: <code>$ ssh -X user@client.server.tld </code> | ||
+ | * Check out the [http://www.dayid.org/os/notes/tm.html tmux and screen cheat sheet] for a quick reference of some of the other tmux commands. An additional command that might be useful is <code>tmux list-sessions</code>. | ||
+ | *[http://mosh.mit.edu Mosh] is another helpful tool you may want to use for high-latency or mobile (e.g. wifi) connections. You also may want to look into zsh, an alternative to bash with more features. | ||
+ | *You also may want to setup an [http://nerderati.com/2011/03/simplify-your-life-with-an-ssh-config-file/ SSH config file] for host aliases and Kerberos authentication. | ||
==Random Bash tips== | ==Random Bash tips== | ||
Line 35: | Line 54: | ||
* Ctrl-D is the universal "end-of-file" command, and can be used to logout of shells | * Ctrl-D is the universal "end-of-file" command, and can be used to logout of shells | ||
* Ctrl-C is the universal interrupt command, and can be used to kill running terminal jobs and clear your currently-typed command (rather than holding down backspace). | * Ctrl-C is the universal interrupt command, and can be used to kill running terminal jobs and clear your currently-typed command (rather than holding down backspace). | ||
+ | * Ctrl-Z can be used to pause processes, then fg or bg can be used to restart it in the foreground or background, respectively | ||
==Troubleshooting== | ==Troubleshooting== | ||
Line 41: | Line 61: | ||
* You (or someone using your IP address) have had too many failed login attempts, and fail2ban or a similar utility has banned you for a period of time, typically a week or so. | * You (or someone using your IP address) have had too many failed login attempts, and fail2ban or a similar utility has banned you for a period of time, typically a week or so. | ||
** This is easy to identify because ssh fails ''before'' you are prompted for a password. | ** This is easy to identify because ssh fails ''before'' you are prompted for a password. | ||
− | ** If this happened on a CVL machine, try connecting to a different node like <code>ssh pid@cvl10.ece.vt.edu</code> | + | ** If this happened on a CVL machine, try connecting to a different node like <code>$ ssh pid@cvl10.ece.vt.edu</code> |
+ | |||
+ | == See Also == | ||
+ | |||
+ | * [[WeeChat]] | ||
+ | * [[Irssi]] | ||
==External Links== | ==External Links== | ||
* [https://blogs.lt.vt.edu/ece2524s13/exercises/week-2-welcome-to-the-shell/#fnref1 Week 2: Welcome to the Shell (from ECE2524 blog)] | * [https://blogs.lt.vt.edu/ece2524s13/exercises/week-2-welcome-to-the-shell/#fnref1 Week 2: Welcome to the Shell (from ECE2524 blog)] | ||
* [http://linuxcommand.org/learning_the_shell.php Learning the Shell - Basic shell commands tutorial] | * [http://linuxcommand.org/learning_the_shell.php Learning the Shell - Basic shell commands tutorial] | ||
+ | * [http://linuxtutorial.todolistme.net Comprehensive Beginners Linux Tutorial] | ||
[[Category:IRC]] | [[Category:IRC]] | ||
[[Category:Howtos]] | [[Category:Howtos]] | ||
[[Category:Featured content]] | [[Category:Featured content]] |
Latest revision as of 22:39, 23 February 2018
This Provides a summary of basic SSH usage on acidburn, with notes for ECE 2524 students as well. In the future, these will be separated into two pages. One advantage of a shell account is that it allows one to leave an IRC client constantly connected, eliminate join/quit spam, and log missed messages to check later. In order to accomplish this, the IRC client must be run inside either tmux or screen so that it will not be killed when you disconnect from SSH.
Contents
CVL SSH accounts
The ECE department offers shell ccounts on the CVL for Virginia Tech affiliates. Accounts can be created at this page.
The ECE2524 VM (128.173.88.125) can be accessed via SSH for CVL users, and has tmux, mosh, and weechat installed. The CVL is also useful for general computing (e.g. MATLAB).
Acidburn
Acidburn (acidburn.vtluug.org), the VTLUUG shell server, has a few more IRC clients installed, as well as other software and full partial IPv6 support. Because of new restrictions on SSH access (all of port 22 is blocked for off-campus users, although we shouldn't be blocked), Acidburn can be accessed at port 2222.
We strongly recommend setting permissions of all files on your acidburn home directory to 600, except for a public_html/ directory.
Basic Usage
Here's the procedure for using either the ECE2524 server or acidburn for IRC:
- Create an account, if you haven't already.
- For the ECE2524 VM, use this page.
- For acidburn, come to a meeting and request an account
- Connect to the remote machine via SSH
ssh pid@ece2524.ece.vt.edu
for the ECE2524 server (with your actual PID)ssh user@acidburn.vtluug.org
for acidburn
- Begin a tmux session to allow your console to persist between logins
user@ece2524:~$ tmux
- Launch an IRC client
user@ece2524:~$ weechat-curses
- Now detach from the tmux session to return to a terminal while leaving weechat running
^b-d
(that is, press Control-b, then d)- Use this whenever you are inside a tmux window and wish to return to a shell
- To, reattach to the first tmux seesion, just use
tmux attach
user@ece2524:~$ tmux attach -d
.- On subsequent logins, this should be the only command you need to execute to return to IRC
If you have been given a temporary password please reset it by running
$ passwd
Other SSH Suggestions
- Use SSH Keys
- Write up your own tmux.conf
- Use X-forwarding on servers that support it:
$ ssh -X user@client.server.tld
- Check out the tmux and screen cheat sheet for a quick reference of some of the other tmux commands. An additional command that might be useful is
tmux list-sessions
. - Mosh is another helpful tool you may want to use for high-latency or mobile (e.g. wifi) connections. You also may want to look into zsh, an alternative to bash with more features.
- You also may want to setup an SSH config file for host aliases and Kerberos authentication.
Random Bash tips
- Tab completion exists on lots of things in your shell. For example, try "cd /" and then "cd /home/<TAB>" and it will autocomplete. It also exists in weechat for users' nicks.
- Man pages are a helpful way to get usage information on commands. For example, run "man mv" in a terminal for usage information on mv. You can use PgUp/PgDn to scroll. Inside a man page, you can search using the "/" key. For example, to search "mv" for "existing file", type "/existing file" and hit enter to highlight all occurances and jump to the first one.
- Inside a terminal, the up and down arrows can be used to recall the previous and next commands respectively, to prevent retyping long commands if you make a mistake.
- Ctrl-D is the universal "end-of-file" command, and can be used to logout of shells
- Ctrl-C is the universal interrupt command, and can be used to kill running terminal jobs and clear your currently-typed command (rather than holding down backspace).
- Ctrl-Z can be used to pause processes, then fg or bg can be used to restart it in the foreground or background, respectively
Troubleshooting
If you get an error like "ssh_exchange_identification: Connection closed by remote host", a few things are likely:
- Your username/password combination is incorrect
- You (or someone using your IP address) have had too many failed login attempts, and fail2ban or a similar utility has banned you for a period of time, typically a week or so.
- This is easy to identify because ssh fails before you are prompted for a password.
- If this happened on a CVL machine, try connecting to a different node like
$ ssh pid@cvl10.ece.vt.edu