SSH

Basic Information

By going through the university-wide SSH gateway server, you can connect to the university network from outside the university via an encrypted communication path using SSH (Secure SHell).

Server name

ssh.cc.uec.ac.jp

Authentication method

Public key cryptography

To access this server, please register your SSH public key in advance from the SSH public key registration system .

Caution

  • Please do not use this server for any purpose other than ssh login relay.

  • Since it is for relay only, there is a capacity limit so that you cannot store anything other than small text files such as configuration files.

Danger

If you save anything other than a small text file, it may not work properly. In that case, please delete the file.

Login (Authentication) Type

The login (authentication) method using SSH is as follows:

There are two. **In principle, please use the key pair method. **

Note

In the future, we plan to gradually make access to the campus from outside the university authentication using a key pair only.

Required Software

The ssh command can be used on OSes such as UNIX, macOS, and Windows.

Hint

The ssh command may not be available by default on some OSes. In that case, please refer to the manual for each OS when installing.

Login With Password

Here, we will explain how to log in using

  • OpenSSH’s ssh Command (UNIX, macOS, Windows 10 or Later)

as a password login method.

OpenSSH’s ssh command (UNIX, macOS, Windows 10 or later)

  1. Start a terminal program (xterm, kterm, gnome-terminal, terminal, etc.).

  2. Perform server connection and authentication.

Please enter the ssh command as shown below.

ssh UECアカウント名@ssh.cc.uec.ac.jp
  1. You will be asked to enter the password for your UEC account. Please enter it.

Note

To log out (disconnect), execute the exit command.If the window does not close, try clicking the “x” in the upper right corner.

Login with Key Pair (Public Key and Private Key)

Basic Flow

Generate a pair of public key and private key (key pair). After registering the public key in the login destination system (Sol), the keys are verified by referring to the private key on the login source PC during authentication.

Warning

Please strictly manage your private key so that it is never known to anyone else.If you are concerned that your private key may be known to someone else, please regenerate and re-register your key pair using this procedure.Although there is no problem with the structure of the key pair even if the public key is known to others, we recommend that you only register it on a trusted server.

Generating and Registering a Key Pair

The SSH Public Key Registration System

You can create and register key pairs in the SSH public key registration system (Requires integrated authentication login with UEC account).

After logging in, you can perform the following three operations.

  • When automatically generating keys

    1. Proceed to 自動生成 (automatic generation) > 確認画面 (confirmation screen) > 秘密鍵のダウンロード (download private key) > 登録・更新 (registration/update) > 終了 (finish).

    2. uec_rsa_key will be downloaded to the download folder of your terminal, so place it under the .ssh directory.

    Windows10 or later

    C:\Users\[Username]\.ssh

    Linux

    ~/.ssh

    1. The public key will be automatically registered in ssh.cc.uec.ac.jp and sol.cc.uec.ac.jp.

    Note

    It will take some time for it to be reflected. Thank you for your understanding. Since it is registered separately from ~/.ssh on the server side, you can also use the private key and public key that you have already set.

    1. Create config under .ssh.

    Here’s how to write it:

    Host <任意の名前>
      HostName ssh.cc.uec.ac.jp
      User <UECアカウント>
      IdentityFile <秘密鍵があるPATH>
    

    Note

    Please write the information for each part enclosed in <>. Also, please do not write < and >.``Any name`` can be set using half-width alphanumeric characters.

    Caution

    The file name is config. Please make sure that there is no extension such as config.txt.

    A setting example is as follows.

    Host uec
      HostName ssh.cc.uec.ac.jp
      User xa000000
      IdentityFile ~/.ssh/uec_rsa_key
    
    1. Open a terminal program (xterm, kterm, gnome-terminal, Terminal, PowerSHell, command prompt, etc.) and execute the ssh command.

    ssh UECアカウント@ssh.cc.uec.ac.jp
    

    Note

    If the config settings are correct, you can log in using ``ssh <any name>’’ using the arbitrary name set in step 4.

    In the case of setting example 4, you can log in using the following command.

    ssh uec
    
  • When entering the key manually

    1. Upload the already generated public key file in the file selection field and proceed to Confirmation screen.

    Note

    If you select “Enter text”, you can also register by pasting text.

    1. It will be automatically uploaded and registered to ssh.cc.uec.ac.jp and sol.edu.cc.uec.ac.jp.

    Note

    It will take some time for it to be reflected. Thank you for your understanding. Since it is registered separately from ~/.ssh on the server side, you can also use the private key and public key that you have already set.

    1. Create config under .ssh.

    Here’s how to write it:

    Host <任意の名前>
      HostName ssh.cc.uec.ac.jp
      User <UECアカウント>
      IdentityFile <秘密鍵があるPATH>
    

    Note

    Please write the information for each part enclosed in <>. Also, please do not write < and >.``Any name`` can be set using half-width alphanumeric characters.

    Caution

    The file name is config. Please make sure that there is no extension such as config.txt.

    A setting example is as follows.

    Host uec
      HostName ssh.cc.uec.ac.jp
      User xa000000
      IdentityFile ~/.ssh/uec_rsa_key
    
    1. Open a terminal program (xterm, kterm, gnome-terminal, Terminal, PowerSHell, command prompt, etc.) and execute the ssh command.

    ssh UECアカウント@ssh.cc.uec.ac.jp
    

    Note

    If the config settings are correct, you can log in using ``ssh <any name>’’ using the arbitrary name set in step 4.

    In the case of setting example 3, you can log in using the following command.

    ssh uec
    
  • When deleting a registered key

    1. When you proceed to the confirmation screen, the currently registered SSH public key will be displayed.

    2. Proceed to Delete to delete the registration.

OpenSSH’s ssh-keygen command (UNIX, macOS, Windows10)

  1. Create a key pair using the ssh-keygen command from a terminal program (xterm, kterm, gnome-terminal, Terminal, PowerSHell, command prompt, etc.).

% ssh-keygen (Enter)
Generating public/private rsa key pair.
Enter file in which to save the key (/homedir/.ssh/id_rsa): (キーの保存場所.通常はそのまま Enter)
Enter passphrase (empty for no passphrase): (パスフレーズを入力)
Enter same passphrase again: (パスフレーズを再入力)
Your identification has been saved in /homedir/.ssh/id_rsa.
<略>
  1. Make sure that id_rsa (private key) and id_rsa.pub (public key) are created in the ~/.ssh/ folder.

    % ls ~/.ssh/
    id_rsa  id_rsa.pub
    
  2. Register the public key on the target server. As shown below, you can use the ssh-copy-id command to register the public key (id_rsa.pub) you created earlier in ~/.ssh/authorized_keys on the login destination server. Masu.

% ssh-copy-id <UECアカウント名>@sol.edu.cc.uec.ac.jp

Caution

This operation is not possible on Windows 10, so please do it manually.

Login

Note

The following method is a login method using a key pair. You need to Generating and Registering a Key Pair in advance. For information on logging in using a password, please refer to Login With Password .

Using OpenSSH’s ssh Command (UNIX, macOS, Windows)

  1. Create a key pair using the ssh-keygen command from a terminal program (xterm, kterm, gnome-terminal, terminal, etc.).

% ssh-keygen (Enter)
Generating public/private rsa key pair.
Enter file in which to save the key (/homedir/.ssh/id_rsa): (キーの保存場所.通常はそのまま Enter)
Enter passphrase (empty for no passphrase): (パスフレーズを入力)
Enter same passphrase again: (パスフレーズを再入力)
Your identification has been saved in /homedir/.ssh/id_rsa.
<略>
  1. Make sure that id_rsa (private key) and id_rsa.pub (public key) are created in the ~/.ssh/ folder.

% ls ~/.ssh/
id_rsa  id_rsa.pub
  1. Register the public key on the target server.

In order to register the public key on the server, you need to copy the contents of the public key you created earlier to ~/.ssh/authorized_keys on the server. (Copy the contents, not the file.)

% ssh-copy-id <UECアカウント名>@sol.edu.cc.uec.ac.jp
  1. Log in with passphrase

If the key exchange has been performed correctly, when logging in using the ssh command, you will be asked to enter the passphrase set in step 1, not the password for the UEC account.

ssh <UECアカウント名>@sol.edu.cc.uec.ac.jp
Enter passphrase for key '/homedir/.ssh/id_rsa': (パスフレーズを入力)

How to Use Socks as a Proxy via ssh.cc.uec.ac.jp

  1. Click Download Firefox on https://www.mozilla.org/ja/ to download the Firefox installer.

  2. Open FireFox and type about:preferences to display the settings screen.

  3. Proceed to Connection settings…(E) in the “Network settings” field at the bottom of the settings.

  4. Select Manually configure proxy(M), select SOCKS v5(V), and enter the following information.

SOCKS host(C)

localhost

Port(T)

1080

  1. Create config under .ssh.

Here’s how to write it:

Host <任意の名前>
  HostName ssh.cc.uec.ac.jp
  User <UECアカウント>
  IdentityFile <秘密鍵があるPATH>
  DynamicForward 1080

Note

Please write the information for each part enclosed in <>. Also, please do not write < and >. Any name can be set using half-width alphanumeric characters. For information on how to register public keys and private keys, please refer to The SSH Public Key Registration System.

Caution

The file name is config. Please make sure that there is no extension such as config.txt.

A setting example is as follows.

Host uec
  HostName ssh.cc.uec.ac.jp
  User xa000000
  IdentityFile ~/.ssh/uec_rsa_key
  1. Open a terminal program (xterm, kterm, gnome-terminal, Terminal, PowerSHell, command prompt, etc.) and execute the ssh command.

ssh UECアカウント@ssh.cc.uec.ac.jp

Note

If the config settings are correct, you can log in using ``ssh <any name>’’ using the arbitrary name set in step 4.

In the case of setting example 5, you can log in using the following command.

ssh uec
  1. It can be used as a SOCKS proxy while an SSH connection is made.

FAQ