Accessing shell servers over SSH: Difference between revisions

From ULYSSIS documentation
No edit summary
No edit summary
 
(23 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<p>Users can access the ULYSSIS servers through two machines: <code>ssh1.ulyssis.org</code> and <code>ssh2.ulyssis.org</code>. Both of them run Linux. You can run commands on these servers or use them to access the files on your ULYSSIS account. The servers can only be accessed trough SSH, not through FTP or any other protocol.</p>
This documentation article is aimed at more advanced users who want to use the command line to administer files or perform other actions on their ULYSSIS account. If you prefer to upload, download, move and delete files on your account using a graphical user interface, then please refer to [[Accessing your files]].


<h2>Running commands</h2>
==Connecting==
Users can access ULYSSIS services through two shell servers: <code>ssh1.ulyssis.org</code> and <code>ssh2.ulyssis.org</code>. Both of them run Linux (the latest Ubuntu LTS). You can run commands on these servers or use them to access the files on your ULYSSIS account. These servers can only be accessed through SSH or SFTP (see [[Accessing your files]] for the latter). For SSH access, use the following details:


To run a command on the shell servers, you will need to connect to them using a terminal. Our servers do not support a full graphical interface.
* Server: "ssh1.ulyssis.org" or "ssh2.ulyssis.org"
* Port: 22
* Username: your ULYSSIS account username, the one you use for [https://ucc.ulyssis.org ucc.ulyssis.org]
* Password: your ULYSSIS account password


<h3>Linux</h3>
===Connecting on Linux===


On Linux, you can just open a terminal and connect to the servers by using one of the following commands (with <code>username</code> your username):
On Linux, you can just open a terminal and connect to the servers by using one of the following commands (with <code>username</code> your ULYSSIS username) followed by your password (once prompted):


<p><code>ssh username@ssh1.ulyssis.org</code></p>
ssh username@ssh1.ulyssis.org
<p><code>ssh username@ssh2.ulyssis.org</code></p>
ssh username@ssh2.ulyssis.org


<p>Enter your password and you're connected. </p>
By doing this, the terminal will now act as a terminal on the remote server. To disconnect, type <code>logout</code>, <code>exit</code> or use Ctrl+D.


<p>By doing this, the terminal will now act as a terminal on the remote server. To disconnect, type <code>logout</code>, <code>exit</code> or use Ctrl+D.</p>
To copy and paste inside a terminal window, you usually have to use Ctrl+Shift+C and Ctrl+Shift+V, but this may depend on your choice of terminal and its settings.


<h3>Windows</h3>
===Connecting on macOS===


Windows doesn't support native terminals, so you will have to download a program first. A good option is [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html Putty], which is completely free and doesn't require any installation. Just download it and run the .exe file. The parameters:
On Mac, you can use Terminal app. This application can be found in the Utilities folder within your Application folder. You can also use Spotlight to find it.
<ul>
<li>Host name: ssh1.ulyssis.org or ssh2.ulyssis.org</li>
<li>Protocol: SSH</li>
<li>Port: 22 (should be set automatically)</li>
</ul>


<p>You can save these options for later on.</p>
You can now connect to the servers by using one of the following commands (with <code>username</code> your username) followed by your password (once prompted):


<p>Next, you will be asked to give your password.</p>
ssh username@ssh1.ulyssis.org
ssh username@ssh2.ulyssis.org


<p>Doing all this will open a terminal to the remote server which can be used the same way as a Linux terminal. To disconnect, type <code>logout</code>, <code>exit</code> or use Ctrl+D.</p>
By doing this, the terminal will now act as a terminal on the remote server. To disconnect, type <code>logout</code>, <code>exit</code> or use ctrl+D.


<p>More information about Putty can be found at http://the.earth.li/~sgtatham/putty/0.60/htmldoc/.
===Connecting on Windows===
==== Windows 10 ====
Windows has built-in SSH capabilities since the April 2018 update of Windows 10. Simply search and launch Powershell from your menu.  


<h3> Mac </h3>
You can now connect to the servers by using one of the following commands (with <code>username</code> your username) followed by your password (once prompted):


On Mac, you can just open Terminal.
ssh username@ssh1.ulyssis.org
This application can be found in the Utilities folder within your Application folder.
ssh username@ssh2.ulyssis.org
If you don't find it there, you can use Spotlight to find it.


You can now connect to the servers by using one of the following commands (with <code>username</code> your username):
By doing this, the terminal will now act as a terminal on the remote server. To disconnect, type <code>logout</code>, <code>exit</code> or use ctrl+D.


<p><code>ssh username@ssh1.ulyssis.org</code></p>
==== Older versions of Windows ====
<p><code>ssh username@ssh2.ulyssis.org</code></p>
Older versions of Windows don't support native terminals, so you will have to download one first. An option that works on any version of Windows is [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html Putty], which is completely free and doesn't require any installation. Just download it and run the .exe file. The parameters:
*Host name: "ssh1.ulyssis.org" or "ssh2.ulyssis.org"
*Protocol: SSH
*Port: 22 (should be set automatically)
You can save these options for later on. Next, you will be asked to give your password.


<p>Enter your password and you're connected. </p>
Doing all this will open a terminal to the remote server which can be used the same way as a Linux terminal. To disconnect, type <code>logout</code>, <code>exit</code> or use Ctrl+D.


<p>By doing this, the terminal will now act as a terminal on the remote server. To disconnect, type <code>logout</code>, <code>exit</code> or use ctrl+D.</p>
To copy and paste in Putty, you have to right click. More information about Putty is available on https://the.earth.li/~sgtatham/putty/latest/htmldoc/.


<h3>Useful ideas</h3>
==Getting started==
Once connected, you can start executing commands to manage your files or perform tasks. You can find a simple overview of basis commands on [[Useful Linux Commands]]. We also have several articles detailing commands for more specific tasks:
*[[Managing Cron jobs]]
*[[Reducing disk usage]]
*[[ULYSSIS public IRC]]
*[[Making Backups]]
*[[Using (Fast)CGI for non-PHP websites]]
*[[Fetch your KU Leuven email into another email address]]


Here are some useful ideas about what you could do with your shell server access:
==Using rsync over SSH==
<ul>
Rsync is a well known utility to transfer and synchronise files across locations. You can use it to synchronise between two local folders, but it also supports synchronisation across an SSH connection. To for example sync the local folder <code>myproject</code> exactly to the <code>www/myproject</code> folder on your ULYSSIS account, you can use the following command:
<li><a href="/docs/fetch-your-kuleuven-mail-in-gmail">Fetch your K.U.Leuven student mail in your Gmail account.</a></li>
<pre>rsync -rLpvz --delete myproject/ username@ssh1.ulyssis.org:~/www/myproject</pre>
<li>Run an IRC client in a screen so you don't miss a thing.</li>
</ul>


<h3>Useful commands</h3>
Refer to the rsync man page (using <code>man rsync</code>) for more details about the many options of rsync, including the use of -L, -p and --delete in the example above.
Some useful commands can be found <a href="http://ulyssis.be/docs/useful-linux-commands">here</a>.
 
[[Category:Shell]]

Latest revision as of 22:41, 18 August 2021

This documentation article is aimed at more advanced users who want to use the command line to administer files or perform other actions on their ULYSSIS account. If you prefer to upload, download, move and delete files on your account using a graphical user interface, then please refer to Accessing your files.

Connecting

Users can access ULYSSIS services through two shell servers: ssh1.ulyssis.org and ssh2.ulyssis.org. Both of them run Linux (the latest Ubuntu LTS). You can run commands on these servers or use them to access the files on your ULYSSIS account. These servers can only be accessed through SSH or SFTP (see Accessing your files for the latter). For SSH access, use the following details:

  • Server: "ssh1.ulyssis.org" or "ssh2.ulyssis.org"
  • Port: 22
  • Username: your ULYSSIS account username, the one you use for ucc.ulyssis.org
  • Password: your ULYSSIS account password

Connecting on Linux

On Linux, you can just open a terminal and connect to the servers by using one of the following commands (with username your ULYSSIS username) followed by your password (once prompted):

ssh username@ssh1.ulyssis.org
ssh username@ssh2.ulyssis.org

By doing this, the terminal will now act as a terminal on the remote server. To disconnect, type logout, exit or use Ctrl+D.

To copy and paste inside a terminal window, you usually have to use Ctrl+Shift+C and Ctrl+Shift+V, but this may depend on your choice of terminal and its settings.

Connecting on macOS

On Mac, you can use Terminal app. This application can be found in the Utilities folder within your Application folder. You can also use Spotlight to find it.

You can now connect to the servers by using one of the following commands (with username your username) followed by your password (once prompted):

ssh username@ssh1.ulyssis.org
ssh username@ssh2.ulyssis.org

By doing this, the terminal will now act as a terminal on the remote server. To disconnect, type logout, exit or use ctrl+D.

Connecting on Windows

Windows 10

Windows has built-in SSH capabilities since the April 2018 update of Windows 10. Simply search and launch Powershell from your menu.

You can now connect to the servers by using one of the following commands (with username your username) followed by your password (once prompted):

ssh username@ssh1.ulyssis.org
ssh username@ssh2.ulyssis.org

By doing this, the terminal will now act as a terminal on the remote server. To disconnect, type logout, exit or use ctrl+D.

Older versions of Windows

Older versions of Windows don't support native terminals, so you will have to download one first. An option that works on any version of Windows is Putty, which is completely free and doesn't require any installation. Just download it and run the .exe file. The parameters:

  • Host name: "ssh1.ulyssis.org" or "ssh2.ulyssis.org"
  • Protocol: SSH
  • Port: 22 (should be set automatically)

You can save these options for later on. Next, you will be asked to give your password.

Doing all this will open a terminal to the remote server which can be used the same way as a Linux terminal. To disconnect, type logout, exit or use Ctrl+D.

To copy and paste in Putty, you have to right click. More information about Putty is available on https://the.earth.li/~sgtatham/putty/latest/htmldoc/.

Getting started

Once connected, you can start executing commands to manage your files or perform tasks. You can find a simple overview of basis commands on Useful Linux Commands. We also have several articles detailing commands for more specific tasks:

Using rsync over SSH

Rsync is a well known utility to transfer and synchronise files across locations. You can use it to synchronise between two local folders, but it also supports synchronisation across an SSH connection. To for example sync the local folder myproject exactly to the www/myproject folder on your ULYSSIS account, you can use the following command:

rsync -rLpvz --delete myproject/ username@ssh1.ulyssis.org:~/www/myproject

Refer to the rsync man page (using man rsync) for more details about the many options of rsync, including the use of -L, -p and --delete in the example above.