Difference between revisions of "Linux Questions"

From CS Support
Jump to: navigation, search
(Created page with "'''NOTE:''' This document borrows heavily from the excellent documentation found in the [http://support.beocat.cis.ksu.edu/BeocatDocs/index.php/LinuxBasics Beocat wiki]. Pleas...")
 
(Example)
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
'''NOTE:''' This document borrows heavily from the excellent documentation found in the [http://support.beocat.cis.ksu.edu/BeocatDocs/index.php/LinuxBasics Beocat wiki]. Please have a look there for more details and in-depth examples.
+
'''NOTE:''' Parts of this document are borrowed heavily from the excellent documentation found in the [http://support.beocat.ksu.edu/BeocatDocs/index.php/LinuxBasics Beocat wiki]. Please have a look there for more details and in-depth examples.
  
== How do I get started with Linux? ==
+
<div id="ConnectLinux"></div>
 +
== How do I connect to Linux systems? ==
  
=== Getting Connected ===
+
To login remotely to CS Linux systems, you first need an "SSH Client". SSH, short for "secure shell", is a protocol that allows secure communication between two computers. We recommend the following.
To login remotely to CIS Linux systems, you first need an "SSH Client". SSH, short for "secure shell", is a protocol that allows secure communication between two computers. We recommend the following.
 
 
* Windows
 
* Windows
** [http://www.chiark.greenend.org.uk/~sgtatham/putty/ PuTTY] is by far the most common SSH client, both for CIS and in the world.
+
** [http://www.chiark.greenend.org.uk/~sgtatham/putty/ PuTTY] is by far the most common SSH client, both for CS and in the world.
 
** [http://mobaxterm.mobatek.net/ MobaXterm] is a fairly new client with some nice features, such as being able to SCP/SFTP (see below), and running X (Linux graphical desktop).
 
** [http://mobaxterm.mobatek.net/ MobaXterm] is a fairly new client with some nice features, such as being able to SCP/SFTP (see below), and running X (Linux graphical desktop).
 
** [http://www.cygwin.com/ Cygwin] is for those that would rather be running Linux but are stuck on Windows. It's purely a text interface.
 
** [http://www.cygwin.com/ Cygwin] is for those that would rather be running Linux but are stuck on Windows. It's purely a text interface.
 
* Macintosh
 
* Macintosh
** OS-X has SSH a built-in application called "Terminal". It's not great, but it will work for most CIS users.
+
** OS-X has SSH a built-in application called "Terminal". It's not great, but it will work for most CS users.
 
** [http://www.iterm2.com/#/section/home iTerm2] is the terminal application we prefer.
 
** [http://www.iterm2.com/#/section/home iTerm2] is the terminal application we prefer.
 
* Others
 
* Others
** There are many SSH clients for many different platforms available. While we don't have experience with many of these, any should be sufficient for access to CIS Linux systems.
+
** There are many SSH clients for many different platforms available. While we don't have experience with many of these, any should be sufficient for access to CS Linux systems.
  
You'll need to connect your client (via the SSH protocol, if your client allows multiple protocols) to cislinux.cis.ksu.edu.
+
You'll need to connect your client (via the SSH protocol, if your client allows multiple protocols) to cislinux.cs.ksu.edu.
  
 
For command-line tools, the command to connect is
 
For command-line tools, the command to connect is
  
<code>ssh username@cislinux.cis.ksu.edu</code>
+
<code>ssh username@cislinux.cs.ksu.edu</code>
  
Your username is your CIS login (usually the same as your [http://eid.ksu.edu K-State eID]) and the password is your CIS password (which is only the same as your eID password if you set it manually or using our [https://password.cis.ksu.edu password reset page]).
+
Your username is your CS login (usually the same as your [http://eid.ksu.edu K-State eID]) and the password is your CS password (which is only the same as your eID password if you set it manually or using our [https://password.cs.ksu.edu password reset page]).
  
 
'''''Note:''''' When you type your password, nothing shows up on the screen, not even asterisks.
 
'''''Note:''''' When you type your password, nothing shows up on the screen, not even asterisks.
Line 28: Line 28:
  
 
You'll know you are successfully logged in when you see a prompt that says
 
You'll know you are successfully logged in when you see a prompt that says
<code>
 
 
  username@hostname:~$
 
  username@hostname:~$
</code>
 
 
where ''hostname'' is the name of the machine you've logged into (currently either 'cougar' or 'viper') and ''username'' is your eID username
 
where ''hostname'' is the name of the machine you've logged into (currently either 'cougar' or 'viper') and ''username'' is your eID username
  
=== Transferring files (SCP or SFTP) ===
+
<div id="FileTransferLinux"></div>
Usually, one of the first things people want to do is to transfer files into or out of their CIS account. To do so, you need to use [http://en.wikipedia.org/wiki/Secure_copy SCP] (secure copy) or [http://en.wikipedia.org/wiki/SSH_File_Transfer_Protocol SFTP] (SSH FTP or Secure FTP). Again, there are multiple programs that do this.  
+
 
 +
== How do I transfer files to/from Linux systems? ==
 +
Usually, one of the first things people want to do is to transfer files into or out of their CS account. To do so, you need to use [http://en.wikipedia.org/wiki/Secure_copy SCP] (secure copy) or [http://en.wikipedia.org/wiki/SSH_File_Transfer_Protocol SFTP] (SSH FTP or Secure FTP). Again, there are multiple programs that do this.  
 
* Windows
 
* Windows
 
** Putty (see above) has PSCP and PSFTP programs (both are included if you run the installer). It is a command-line interface (CLI) rather than a graphical user interface (GUI).  
 
** Putty (see above) has PSCP and PSFTP programs (both are included if you run the installer). It is a command-line interface (CLI) rather than a graphical user interface (GUI).  
Line 47: Line 47:
 
** FileZilla also has a GUI linux version, in additon to the CLI tools.
 
** FileZilla also has a GUI linux version, in additon to the CLI tools.
  
==== Using a Command-Line Interface (CLI) ====
+
=== Using a Command-Line Interface (CLI) ===
 
You can safely ignore this section if you're using a graphical interface (GUI).
 
You can safely ignore this section if you're using a graphical interface (GUI).
  
===== Example: transfer a file called myfile.txt in your current folder to your home directory on CISLinux. =====
+
==== Example ====
 +
Transfer a file called myfile.txt in your current folder to your home directory on CISLinux.
  
I am using my username (`sgsax`) here. You should replace this with your own when you run these commands.
+
I am using my username ("sgsax") here. You should replace this with your own when you run these commands.
  
 
Using SCP:
 
Using SCP:
<code>
+
  scp myfile.txt sgsax@cislinux.cs.ksu.edu:
  scp myfile.txt sgsax@cislinux.cis.ksu.edu:
 
 
  Password: (type your password here, it will not show any response on the screen)
 
  Password: (type your password here, it will not show any response on the screen)
 
  myfile.txt                                                                            100%    0    0.0KB/s  00:00
 
  myfile.txt                                                                            100%    0    0.0KB/s  00:00
</code>
 
  
 
Note the colon at the end of the 'scp' line.
 
Note the colon at the end of the 'scp' line.
  
 
Using SFTP:
 
Using SFTP:
<code>
+
  sftp sgsax@cislinux.cs.ksu.edu
  sftp sgsax@cislinux.cis.ksu.edu
 
 
  Password: (type your password here, it will not show any response on the screen)
 
  Password: (type your password here, it will not show any response on the screen)
  Connected to cislinux.cis.ksu.edu.
+
  Connected to cislinux.cs.ksu.edu.
 
  sftp> put myfile.txt
 
  sftp> put myfile.txt
 
  Uploading myfile.txt to /home/s/sgsax/myfile.txt
 
  Uploading myfile.txt to /home/s/sgsax/myfile.txt
 
  myfile.txt                                                                            100%    0    0.0KB/s  00:00
 
  myfile.txt                                                                            100%    0    0.0KB/s  00:00
 
  sftp> exit
 
  sftp> exit
</code>
 
  
 
SFTP is interactive, so this is a two-step process. First, you connect to CISLinux, then you transfer the file. As long as the system gives the <code>sftp> </code> prompt, you are in the sftp program, and you will remain there until you type 'exit'.
 
SFTP is interactive, so this is a two-step process. First, you connect to CISLinux, then you transfer the file. As long as the system gives the <code>sftp> </code> prompt, you are in the sftp program, and you will remain there until you type 'exit'.
  
For more examples of advanced usage, please visit the [http://support.beocat.cis.ksu.edu/BeocatDocs/index.php/LinuxBasics Beocat wiki].
+
For more examples of advanced usage, please visit the [http://support.beocat.ksu.edu/BeocatDocs/index.php/LinuxBasics Beocat wiki].
 +
 
 +
== How do I use Linux? ==
 +
Please read our [[Linux Primer]]
 +
 
 +
== Why can't I login to the Linux lab? ==
 +
'''Problem:'''
 +
When you try to login to a Linux lab desktop, the screen goes black and then reverts immediately to the login screen.  No errors are displayed.
 +
 
 +
'''Cause:'''
 +
This is due to corruption or incompatibility of one of your X.org configuration files.  The solution is to remove this file.
 +
 
 +
'''Resolution:'''
 +
# Press <Ctrl>-<Alt>-<F1> to switch to a local virtual console and login using your regular credentials.
 +
# At the prompt (ending with a $ character), type the following and press <Enter>
 +
#: <code>rm .Xauthority</code>
 +
# Logout using either <code>logout</code> or <code>exit</code>
 +
# Switch back the the GUI login screen by pressing <Ctrl>-<Alt>-<F7>
 +
 
 +
You should now be able to login as usual.
 +
 
 +
<div id="KSUWifi"></div>
 +
== How do I get on KSU Wireless from my Linux laptop? ==
 +
The official documentation from ITS for doing this is incorrect. The following settings should work for Ubuntu users, but other distros should be similar. Open your wireless connection settings and make these changes for the KSU Wireless network:
 +
* Security: WPA & WPA2 Enterprise
 +
* Authentication: Protected EAP (PEAP)
 +
* CA certificate: AddTrust_External_Root.pem (may need to manually locate this in <code>/etc/ssl/certs</code>)
 +
* PEAP version: Automatic
 +
* Inner authentication: MSCHAPv2
 +
* Username: <code><your eID></code>
 +
* Password: <code><your eID password></code> (or leave blank to be prompted)

Revision as of 11:39, 29 January 2020

NOTE: Parts of this document are borrowed heavily from the excellent documentation found in the Beocat wiki. Please have a look there for more details and in-depth examples.

How do I connect to Linux systems?

To login remotely to CS Linux systems, you first need an "SSH Client". SSH, short for "secure shell", is a protocol that allows secure communication between two computers. We recommend the following.

  • Windows
    • PuTTY is by far the most common SSH client, both for CS and in the world.
    • MobaXterm is a fairly new client with some nice features, such as being able to SCP/SFTP (see below), and running X (Linux graphical desktop).
    • Cygwin is for those that would rather be running Linux but are stuck on Windows. It's purely a text interface.
  • Macintosh
    • OS-X has SSH a built-in application called "Terminal". It's not great, but it will work for most CS users.
    • iTerm2 is the terminal application we prefer.
  • Others
    • There are many SSH clients for many different platforms available. While we don't have experience with many of these, any should be sufficient for access to CS Linux systems.

You'll need to connect your client (via the SSH protocol, if your client allows multiple protocols) to cislinux.cs.ksu.edu.

For command-line tools, the command to connect is

ssh username@cislinux.cs.ksu.edu

Your username is your CS login (usually the same as your K-State eID) and the password is your CS password (which is only the same as your eID password if you set it manually or using our password reset page).

Note: When you type your password, nothing shows up on the screen, not even asterisks.

The first time you log into a new host, you will be asked to confirm adding the SSL signature to your local repository. Just say "yes" in whatever appropriate form when asked.

You'll know you are successfully logged in when you see a prompt that says

username@hostname:~$

where hostname is the name of the machine you've logged into (currently either 'cougar' or 'viper') and username is your eID username

How do I transfer files to/from Linux systems?

Usually, one of the first things people want to do is to transfer files into or out of their CS account. To do so, you need to use SCP (secure copy) or SFTP (SSH FTP or Secure FTP). Again, there are multiple programs that do this.

  • Windows
    • Putty (see above) has PSCP and PSFTP programs (both are included if you run the installer). It is a command-line interface (CLI) rather than a graphical user interface (GUI).
    • MobaXterm (see above) has a built-in GUI SFTP client that automatically changes the directories as you change them in your SSH session.
    • FileZilla (client) has an easy-to-use GUI. Be sure to use 'SFTP' mode rather than 'FTP' mode.
    • WinSCP is another easy-to-use GUI.
    • Cygwin (see above) has CLI scp and sftp programs.
  • Macintosh
    • FileZilla is also available for OS-X.
    • Within terminal or iTerm, you can use the 'scp' or 'sftp' programs.
  • Linux
    • FileZilla also has a GUI linux version, in additon to the CLI tools.

Using a Command-Line Interface (CLI)

You can safely ignore this section if you're using a graphical interface (GUI).

Example

Transfer a file called myfile.txt in your current folder to your home directory on CISLinux.

I am using my username ("sgsax") here. You should replace this with your own when you run these commands.

Using SCP:

scp myfile.txt sgsax@cislinux.cs.ksu.edu:
Password: (type your password here, it will not show any response on the screen)
myfile.txt                                                                            100%    0     0.0KB/s   00:00

Note the colon at the end of the 'scp' line.

Using SFTP:

sftp sgsax@cislinux.cs.ksu.edu
Password: (type your password here, it will not show any response on the screen)
Connected to cislinux.cs.ksu.edu.
sftp> put myfile.txt
Uploading myfile.txt to /home/s/sgsax/myfile.txt
myfile.txt                                                                            100%    0     0.0KB/s   00:00
sftp> exit

SFTP is interactive, so this is a two-step process. First, you connect to CISLinux, then you transfer the file. As long as the system gives the sftp> prompt, you are in the sftp program, and you will remain there until you type 'exit'.

For more examples of advanced usage, please visit the Beocat wiki.

How do I use Linux?

Please read our Linux Primer

Why can't I login to the Linux lab?

Problem: When you try to login to a Linux lab desktop, the screen goes black and then reverts immediately to the login screen. No errors are displayed.

Cause: This is due to corruption or incompatibility of one of your X.org configuration files. The solution is to remove this file.

Resolution:

  1. Press <Ctrl>-<Alt>-<F1> to switch to a local virtual console and login using your regular credentials.
  2. At the prompt (ending with a $ character), type the following and press <Enter>
    rm .Xauthority
  3. Logout using either logout or exit
  4. Switch back the the GUI login screen by pressing <Ctrl>-<Alt>-<F7>

You should now be able to login as usual.

How do I get on KSU Wireless from my Linux laptop?

The official documentation from ITS for doing this is incorrect. The following settings should work for Ubuntu users, but other distros should be similar. Open your wireless connection settings and make these changes for the KSU Wireless network:

  • Security: WPA & WPA2 Enterprise
  • Authentication: Protected EAP (PEAP)
  • CA certificate: AddTrust_External_Root.pem (may need to manually locate this in /etc/ssl/certs)
  • PEAP version: Automatic
  • Inner authentication: MSCHAPv2
  • Username: <your eID>
  • Password: <your eID password> (or leave blank to be prompted)