Difference between revisions of "Linux - System Setup"

From Computer Science
Jump to: navigation, search
(ISU CS Lab Computers)
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
This page is meant to help you get your computer ready to connect to the CS server.   
 
This page is meant to help you get your computer ready to connect to the CS server.   
  
''This page is a part of the [[Linux and CS Systems - Getting Started]]''.
+
''Note - this page needs updating, was last updated in 2020.''
 
 
''Video demo, one per OS, coming soon.''
 
 
 
Note - for additional software and configuration beyond that listed on this page see [[Linux - System Setup 2]].
 
  
 
=CS User Accounts=
 
=CS User Accounts=
Line 19: Line 15:
  
 
==Terminal Program==
 
==Terminal Program==
 +
A terminal program allows you to type commands to run programs and view files and folders on your computer, and allows you to do the same on a remote computer (i.e., the CS server) after you have connected to it.
 +
 
If you are using MacOS, Linux, or an up to date Windows system then you already have a terminal program installed.  You don't need to install anything, you just need to follow some steps to use the terminal program that is already installed.   
 
If you are using MacOS, Linux, or an up to date Windows system then you already have a terminal program installed.  You don't need to install anything, you just need to follow some steps to use the terminal program that is already installed.   
  
 
''Note - the first time you connect to the CS server with a terminal or file transfer program, you will be notified that the identity of cs.indstate.edu cannot be verified, an ECDSA key will be displayed, and you will be asked if you still want to connect.  Type or click yes.''
 
''Note - the first time you connect to the CS server with a terminal or file transfer program, you will be notified that the identity of cs.indstate.edu cannot be verified, an ECDSA key will be displayed, and you will be asked if you still want to connect.  Type or click yes.''
  
* '''On Windows''' - you have two options - use the built-in ssh client if your Windows computer is up to date, or install a terminal program. [https://youtu.be/kqkgXhKjAP8 video demo of both options]
+
* '''On Windows''' - you have two options - use the built-in ssh client if your Windows computer is up to date, or install a terminal program. [https://youtu.be/kqkgXhKjAP8 video demo of both options from around 2020]
 
** ''Built-in ssh'' - Click the start button, type cmd, click Command Prompt to open the command prompt program, then in this window type "ssh username@cs.indstate.edu" and then enter (but with your CS username) to start your connection to the CS server.  Note that you need an up to date Windows 10 for the ssh program to be pre-installed.
 
** ''Built-in ssh'' - Click the start button, type cmd, click Command Prompt to open the command prompt program, then in this window type "ssh username@cs.indstate.edu" and then enter (but with your CS username) to start your connection to the CS server.  Note that you need an up to date Windows 10 for the ssh program to be pre-installed.
 
** ''Putty'' -  [https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html download] [http://cs.indstate.edu/FAQ/PuTTY/ Installing Putty on Windows].  Putty has some features that the built-in ssh client does not; either are sufficient to get started.  
 
** ''Putty'' -  [https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html download] [http://cs.indstate.edu/FAQ/PuTTY/ Installing Putty on Windows].  Putty has some features that the built-in ssh client does not; either are sufficient to get started.  
Line 31: Line 29:
  
 
==File Transfer Program==
 
==File Transfer Program==
You will eventually need to transfer files between your personal computer and the CS server.  Most OSes has built-in support to do this, but there are other options that are easier to use.  We recommend choosing a file transfer program to install.  For Windows or Mac you will download the installer to install the program.  If you are using Linux or Chromebook, see the sections below about these environments.
+
You will eventually need to transfer files between your personal computer and the CS server.  Most OSes have built-in support to do this, but there are other options that are easier to use.  We recommend choosing a file transfer program to install.  For Windows or Mac you will download the installer to install the program.  If you are using Linux or Chromebook, see the sections below about these environments.
 
* [https://cyberduck.io/download/ CyberDuck] - works for MacOS or Windows, is freeware, click the large "Download for Windows" or "Download for macOS" in the middle of the page.
 
* [https://cyberduck.io/download/ CyberDuck] - works for MacOS or Windows, is freeware, click the large "Download for Windows" or "Download for macOS" in the middle of the page.
 
* [https://winscp.net/eng/download.php WinSCP] - works for Windows, scroll past ads and click the "Download WINSCP" button.
 
* [https://winscp.net/eng/download.php WinSCP] - works for Windows, scroll past ads and click the "Download WINSCP" button.
Line 38: Line 36:
 
''Note - the first time you connect to the CS server with a terminal or file transfer program, you will be notified that the identity of cs.indstate.edu cannot be verified, an ECDSA key will be displayed, and you will be asked if you still want to connect.  Type or click yes.''
 
''Note - the first time you connect to the CS server with a terminal or file transfer program, you will be notified that the identity of cs.indstate.edu cannot be verified, an ECDSA key will be displayed, and you will be asked if you still want to connect.  Type or click yes.''
  
''Note - make sure to choose "sftp" as opposed to "ftp" when connecting.  ftp is not encrypted and is turned off on the CS server.  sftp is encrypted and is what we use.''
+
''Note - make sure to choose "sftp" as opposed to "ftp" when connecting.  ftp is not encrypted and is disabled on the CS server (it will not work).  sftp is encrypted and is what we use.''
  
 
''Text-based sftp program that is already installed on many systems - see OS Specific Notes below''
 
''Text-based sftp program that is already installed on many systems - see OS Specific Notes below''
Line 45: Line 43:
 
Note that while you are using a terminal that is connected to the CS server you can use text-based editors - nano, emacs, vim, jove (see [[Linux Terminal - Text Editors]] for more on how to get started with these).  You will eventually want to have a good text editor on your personal computer.  
 
Note that while you are using a terminal that is connected to the CS server you can use text-based editors - nano, emacs, vim, jove (see [[Linux Terminal - Text Editors]] for more on how to get started with these).  You will eventually want to have a good text editor on your personal computer.  
  
The following are four good options that are cross-platform - can be installed on Mac, Windows, Linux, and Chromebook.  If you already use some other option (e.g., MS visual studio, Eclipse, Notepad++, or anything else that is used by programmers) feel free to keep using what you are already using.  Note that Word is ''not'' a good text editor (for our purposes).
+
The following are four good options that are cross-platform - can be installed on Mac, Windows, Linux, and Chromebook.  If you already use some other option (e.g., Visual Studio Code, Eclipse, Notepad++, or anything else that is used by programmers) feel free to keep using what you are already using.  Note that Word is ''not'' a text editor - it does not store files in plain text, which is what is needed for programming.
 
* [https://kate-editor.org/get-it/ Kate] - make sure to download the "release" installer.
 
* [https://kate-editor.org/get-it/ Kate] - make sure to download the "release" installer.
* [https://atom.io/ Atom] - used by Luke May, also in CS 151, click the large Download button (it auto-detects what OS you are running).
+
* [https://www.sublimetext.com/ Submlime] - used by Luke May.
 
* [https://www.gnu.org/software/emacs/ Emacs] - used by Jeff Kinne, click "GNU/Linux", "Windows", or "MacOS" depending on your OS and follow the instructions.   
 
* [https://www.gnu.org/software/emacs/ Emacs] - used by Jeff Kinne, click "GNU/Linux", "Windows", or "MacOS" depending on your OS and follow the instructions.   
 
** For Windows, download is from https://ftp.gnu.org/gnu/emacs/windows/, choose the latest emacs-## folder to click on, then download the zip file at the bottom that ends in "-x86_64.zip", extract the zip to somewhere to keep the program (e.g., C:\Program Files\), then run the file runemacs.exe in the bin directory.
 
** For Windows, download is from https://ftp.gnu.org/gnu/emacs/windows/, choose the latest emacs-## folder to click on, then download the zip file at the bottom that ends in "-x86_64.zip", extract the zip to somewhere to keep the program (e.g., C:\Program Files\), then run the file runemacs.exe in the bin directory.
 
** For macOS, the easiest install is from https://emacsformacosx.com/
 
** For macOS, the easiest install is from https://emacsformacosx.com/
* [https://www.vim.org/download.php Vim] - used by Rob Sternfeld, Geoff Exoo.  For Windows, download and run the "self-installing executable".  For macOS download and run MacVim.dmg from https://github.com/macvim-dev/macvim/releases/latest
+
* [https://www.vim.org/download.php Vim] - used by Geoff Exoo.  For Windows, download and run the "self-installing executable".  For macOS download and run MacVim.dmg from https://github.com/macvim-dev/macvim/releases/latest
 +
* VS Code
 +
* ne (nice editor)
  
 
When starting a new text editor do an internet search for a tutorial to get you started; once you are comfortable with the basics do an internet search for a cheat sheet of keyboard shortcuts to help you remember them.
 
When starting a new text editor do an internet search for a tutorial to get you started; once you are comfortable with the basics do an internet search for a cheat sheet of keyboard shortcuts to help you remember them.
Line 71: Line 71:
 
sudo apt install atom
 
sudo apt install atom
 
</pre>
 
</pre>
''Other Linux distributions'' use different package managers.  If you use a different Linux distribution and are unable to figure out how to install packages you can ask your instructor, the associate chairperson for CS, or the CS system administrator.
+
''Other Linux distributions'' use different package managers.  If you use a different Linux distribution and are unable to figure out how to install packages you can ask your instructor, your advisor, or the CS system administrator.
  
 
After installing the above programs you can open them from the terminal (i.e., to open filezilla you type the command, filezilla).  The programs may also appear in the graphical menu of programs.
 
After installing the above programs you can open them from the terminal (i.e., to open filezilla you type the command, filezilla).  The programs may also appear in the graphical menu of programs.
Line 109: Line 109:
 
* get - download a file from the server to your computer
 
* get - download a file from the server to your computer
 
* quit
 
* quit
 +
 +
==Compilers/Interpreters==
 +
 +
===Python===
 +
 +
===C/C++===
 +
 +
==Backing up Files - Rsync==
 +
 +
==GUI Programs X-Windows==
  
 
=Sample HW=
 
=Sample HW=

Latest revision as of 16:17, 5 January 2023

This page is meant to help you get your computer ready to connect to the CS server.

Note - this page needs updating, was last updated in 2020.

CS User Accounts

Below we guide you through getting software setup on your computer. In order to connect to the CS server you will also need your CS user account. CS accounts are normally distributed during the first week of classes. If you are a CS major, you can also request a permanent CS account. See CS Accounts and CS Lab Computers.

ISU CS Lab Computers

The computers in ISU CS labs (Root Hall A-015, A-017, A-019) and GA offices are already configured with Linux. You can use these computers as long as you have a CS account. These computers already have everything they need installed. If you are able to work on classes in the lab this is a way to get started on CS courses without needing to get your personal computer setup yet.

Your Personal Computer

You need to have access to a computer that you can install the following on - (a) terminal program used to connect to the CS server and execute commands on the CS server, (b) file transfer program for transferring files between your computer and the CS server, (c) text editor to use on your computer.

The minimum to get you started is to get a terminal program working. You can use the terminal program to connect to the CS server and do your work in the terminal. Eventually you will want to get setup with a file transfer program and text editor on your personal computer, but you can get started just with a terminal.

Terminal Program

A terminal program allows you to type commands to run programs and view files and folders on your computer, and allows you to do the same on a remote computer (i.e., the CS server) after you have connected to it.

If you are using MacOS, Linux, or an up to date Windows system then you already have a terminal program installed. You don't need to install anything, you just need to follow some steps to use the terminal program that is already installed.

Note - the first time you connect to the CS server with a terminal or file transfer program, you will be notified that the identity of cs.indstate.edu cannot be verified, an ECDSA key will be displayed, and you will be asked if you still want to connect. Type or click yes.

  • On Windows - you have two options - use the built-in ssh client if your Windows computer is up to date, or install a terminal program. video demo of both options from around 2020
    • Built-in ssh - Click the start button, type cmd, click Command Prompt to open the command prompt program, then in this window type "ssh username@cs.indstate.edu" and then enter (but with your CS username) to start your connection to the CS server. Note that you need an up to date Windows 10 for the ssh program to be pre-installed.
    • Putty - download Installing Putty on Windows. Putty has some features that the built-in ssh client does not; either are sufficient to get started.
  • On Mac OS - Built-in Terminal - video demo Use the built-in Terminal program in Mac OS to connect to the cs server, and you can also use the Terminal program to run commands on your local computer. You open the terminal by opening Finder, then click on Applications, then click on Utilities, then open Terminal. When you get the terminal program open, you can login remotely to the CS server by typing "ssh username@cs.indstate.edu" and enter/return (but with your CS username).
  • On Chromebook - Install the Secure Shell app - video demo, Download Chrome Extension configuration
  • On Linux - Built-in Terminal - Similar to MacOS, a terminal program is already built-in. How to get to the terminal program (also called the "shell") depends on which distribution you are running - ask the internet where to find the terminal program for your distribution. When you get the terminal program open, you can login remotely to the CS server by typing "ssh username@cs.indstate.edu" and enter/return (but with your CS username).

File Transfer Program

You will eventually need to transfer files between your personal computer and the CS server. Most OSes have built-in support to do this, but there are other options that are easier to use. We recommend choosing a file transfer program to install. For Windows or Mac you will download the installer to install the program. If you are using Linux or Chromebook, see the sections below about these environments.

  • CyberDuck - works for MacOS or Windows, is freeware, click the large "Download for Windows" or "Download for macOS" in the middle of the page.
  • WinSCP - works for Windows, scroll past ads and click the "Download WINSCP" button.
  • gFTP - good option for Linux, see below about Linux for how to install.

Note - the first time you connect to the CS server with a terminal or file transfer program, you will be notified that the identity of cs.indstate.edu cannot be verified, an ECDSA key will be displayed, and you will be asked if you still want to connect. Type or click yes.

Note - make sure to choose "sftp" as opposed to "ftp" when connecting. ftp is not encrypted and is disabled on the CS server (it will not work). sftp is encrypted and is what we use.

Text-based sftp program that is already installed on many systems - see OS Specific Notes below

Text Editor

Note that while you are using a terminal that is connected to the CS server you can use text-based editors - nano, emacs, vim, jove (see Linux Terminal - Text Editors for more on how to get started with these). You will eventually want to have a good text editor on your personal computer.

The following are four good options that are cross-platform - can be installed on Mac, Windows, Linux, and Chromebook. If you already use some other option (e.g., Visual Studio Code, Eclipse, Notepad++, or anything else that is used by programmers) feel free to keep using what you are already using. Note that Word is not a text editor - it does not store files in plain text, which is what is needed for programming.

  • Kate - make sure to download the "release" installer.
  • Submlime - used by Luke May.
  • Emacs - used by Jeff Kinne, click "GNU/Linux", "Windows", or "MacOS" depending on your OS and follow the instructions.
    • For Windows, download is from https://ftp.gnu.org/gnu/emacs/windows/, choose the latest emacs-## folder to click on, then download the zip file at the bottom that ends in "-x86_64.zip", extract the zip to somewhere to keep the program (e.g., C:\Program Files\), then run the file runemacs.exe in the bin directory.
    • For macOS, the easiest install is from https://emacsformacosx.com/
  • Vim - used by Geoff Exoo. For Windows, download and run the "self-installing executable". For macOS download and run MacVim.dmg from https://github.com/macvim-dev/macvim/releases/latest
  • VS Code
  • ne (nice editor)

When starting a new text editor do an internet search for a tutorial to get you started; once you are comfortable with the basics do an internet search for a cheat sheet of keyboard shortcuts to help you remember them.

Installing for Linux

Most Linux distributions have their own package management systems, with the programs mentioned on this page being installable via the package management system. There often is a graphical interface to the package management system, and there is normally a text-based interface - you type commands on the terminal to install packages.

Debian, Ubuntu, and related Linux distributions use the APT package manager, and you can install the programs mentioned on this page by entering the following commands in the terminal. Note that you will likely be asked in the terminal whether you want to install the package, you need to type Y and press enter.

sudo apt update  # makes sure APT has the latest information about packages available
sudo apt install emacs
sudo apt install kate
sudo apt install gftp
sudo apt install vim
# Note - installing atom requires adding the repository where atom is kept
wget -qO - https://packagecloud.io/AtomEditor/atom/gpgkey | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64] https://packagecloud.io/AtomEditor/atom/any/ any main" > /etc/apt/sources.list.d/atom.list'
sudo apt update
sudo apt install atom

Other Linux distributions use different package managers. If you use a different Linux distribution and are unable to figure out how to install packages you can ask your instructor, your advisor, or the CS system administrator.

After installing the above programs you can open them from the terminal (i.e., to open filezilla you type the command, filezilla). The programs may also appear in the graphical menu of programs.

Chromebook

On Chromebook you can choose whether to install apps and do all of your work connected to the CS server, or install Linux on your Chromebook and then use the instructions above on installing the programs.

Using apps - Install the following apps.

  • Text Editor - Text
  • Terminal Program - Secure Shell
  • File Transfer Program - use the builtin Files app along with the Secure Shell app, configure as follows.
    • Open the Files app.
    • Click on the triple-dots in the upper right of the Files app, click Add new service, click Secure Shell App.
    • On the Secure Shell App screen that comes up, enter your login information with cs.indstate.edu as the server and 22 as the port. Then click SFTP Mount.
    • Go back to the Files app and you will see LOGIN@cs.indstate.edu:22 as an option on the left.

Linux (Beta) on Chromebook

  • Not all chromebooks allow installation of Linux (Beta). If this works then you will have Linux installed on your Chromebook and will be able to use any of the commands that you use on the CS server.
  • Follow instructions from google.
  • Note - installation could take a very long time (e.g., an hour or more). If installation fails you may need to select Remove Linux Beta and try again.
  • Once installation is complete you open a terminal using the Terminal app. To install the programs mentioned on this page follow the instructions above for Linux (using the APT package manager commands).
  • After the programs are installed you can open them by typing the command in the Terminal or by opening them as apps.

Copy/paste - in either the Secure Shell app or the Terminal app, copy/paste as follows. To copy, simply select text with the mouse and it will be copied to the clipboard. To paste, do a triple-click (three finger click).

Other OS-Specific Notes

If you are using Windows and have Putty installed as your terminal program, it installs a text-based file transfer program as well - psftp - which you should be able to find in your list of programs.

If you are using MacOS or Linux, a text-based file transfer program - sftp - is normally installed by default.

In either case, new users often prefer to use graphical file transfer programs (those mentioned above).

For the text-based sftp programs, the basic commands you will need.

  • ls, cd, pwd - show you the files on the server and change directories on the server.
  • lls, lcd, lpwd - show you the files on your computer and change directories on your computer.
  • put - send a file from your computer to the server (from your current directory on your computer, to the current directory on the server).
  • get - download a file from the server to your computer
  • quit

Compilers/Interpreters

Python

C/C++

Backing up Files - Rsync

GUI Programs X-Windows

Sample HW

The following might be used by your instructor as part of a HW assignment to verify you have your computer setup properly.

  1. Follow the steps above to setup your computer with a file transfer program, text editor, and terminal program. Make sure you are able to use the file transfer program and terminal programs to connect to your CS class account on the CS server.
  2. Make sure you can open the text editor. Create a text file aboutMySystem.txt and put the following information.
    1. Your name:
    2. Your CS class account:
    3. Operating System:
    4. Text editor you are using:
    5. File transfer program:
    6. Did you have any difficulties in getting the programs setup? If yes, explain.
  3. Create the following screen shots demonstrating that you have the programs installed on your system properly. Note - you can ask the internet how to take a screenshot (e.g., type in - how to screenshot on chromebook). For each screenshot, make the screenshot of your whole screen (so I can see which OS you are running on and the program open and connected).
    1. textEditor.jpg - a screenshot that shows you editing the aboutMySystem.txt file with your text editor.
    2. fileTransfer.jpg - a screenshot that shows you using the file transfer program to connect to the CS server with your CS class account.
    3. terminal.jpg - a screenshot that shows you with the terminal program open and connected to the CS server with your CS class account.
  4. Use the file transfer program to connect to the CS server with your CS class account.
    1. While connected, create a new directory in your CS class account on the CS server. Name the new directory SystemSetup.
    2. Transfer the files you just created (aboutMySystem.txt, textEditor.jpg, fileTransfer.jpg, terminal.jpg) into the SystemSetup directory in your CS class account on the server.