The text of a manual · part 34 of 49
Cyclades-TS User Guide: Appendix A - New User Background Information, pages 325 to 333
Pages 325 to 333 of 454, from Cyclades-TS User Guide
The original document is the PDF (4.3 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Cyclades TS2000 and Avocent TS2000
Page 325
Appendix A - New User Background Information Users and Passwords
Appendix A - New User Background Information
A username and password are necessary to log in to the Cyclades-TS. The user root is predefined, with a password tslinux. A password should be configured as soon as possible to avoid unauthorized access. Type the command: passwd to create a password for the root user. To create a regular user (without root privileges), use the commands: adduser user_name passwd user_password To log out, type “logout” at the command prompt.
A regular user who wants to run the command su - to become a superuser needs to: Step 1:
Make sure the group wheel is already created. An administrator with root access would run the following command: addgroup wheel In file /etc/group there should be a line with at least the following: wheel::zzz:
Step 2:
Belong to the group wheel. An administrator with root access would edit /etc/group file and insert the username at the end of the wheel line. For example, for user steve, the administrator would edit the line in file/etc/group: wheel::zzz: to add "steve" at the end like this: wheel::zzz:steve
User Guide
325
Page 326
Appendix A - New User Background Information How to show who is logged in and what they are doing The command “w” displays information about the users currently on the machine, and their processes. It calls two commands: w_ori and w_cas. The w_ori is the new name of the original command “w” and the w_cas shows the CAS sessions information. The header of w_ori shows, in this order: the current time, how long the system has been running, how many users are currently logged on (excluded the CAS users), and the system load averages for the past 1, 5, and 15 minutes. The following entries are displayed for each user (excluded the CAS users): login name, the tty name, the remote host, login time, idle time, JCPU time (it is the time used by all processes attached to the tty), PCPU time (it is the time used by the current process, named in the “what” field), and the command line of their current process. The header of w_cas shows how many CAS users are currently logged on. The following entries are displayed for each CAS user: login name, the tty name, the remote host and remote port, login time, the process ID and the command line of the current process.
Linux File Structure The Linux file system is organized hierarchically, with the base (or root) directory represented by the symbol “/”. All folders and files are nested within each other below this base directory. The directories located just below the base directory are: /home
Contains the work directories of system users.
/bin
Contains applications and utilities used during system initialization.
/dev
Contains files for devices and ports.
/etc
Contains configuration files specific to the operating system.
/lib
Contains shared libraries.
/proc
Contains process information.
326
Cyclades-TS
Page 327
Appendix A - New User Background Information /mnt
Contains information about mounted disks.
/opt
Location where packages not supplied with the operating system are stored.
/tmp
Location where temporary files are stored.
/usr
Contains most of the operating system files.
/var
Contains operating system data files.
Basic File Manipulation Commands The basic file manipulation commands allow the user to copy, delete, and move files and create and delete directories. cp file_name destination a) cp text.txt /tmp b) cp /chap/robo.php ./excess.php
Copies the file indicated by file_name to the path indicated by destination. a) Copies the file text.txt in the current directory to the tmp directory. b) Copies the file robo.php in the chap directory to the current directory and renames the copy excess.php.
rm file_name
Removes the file indicated by file_name.
mv file_name destination
Moves the file indicated by file_name to the path indicated by destination.
mkdir directory_name a) mkdir spot b) mkdir /tmp/snuggles
Creates a directory named directory_name. a) creates the directory spot in the current directory. b) creates the directory snuggles in the directory tmp.
rmdir directory_name
Removes the directory indicated by directory_name.
Other commands allow the user to change directories and see the contents of a directory.
User Guide
327
Page 328
Appendix A - New User Background Information pwd
Supplies the name of the current directory. While logged in, the user is always “in” a directory. The default initial directory is the user's home directory: /home/<username> ls [options] directory_name
Lists the files and directories within directory_name. Some useful options are -l for more detailed output and -a which shows hidden system files.
cd directory_name
Changes the directory to the one specified.
cat file_name
Prints the contents of file_name to the screen.
Shortcuts: . (one dot)
Represents the current directory.
.. (two dots)
Represents one directory above the current directory (i.e. one directory closer to the base directory).
The vi Editor To edit a file using the vi editor, type: vi file_name Vi is a three-state line editor: it has a command mode, a line mode and an editing mode. If in doubt as to which mode you are in, press the <ESC> key which will bring you to the command mode.
328
Cyclades-TS
Page 329
Appendix A - New User Background Information Table 17: vi modes Mode
What is done there
How to get there
Command mode
Navigation within the open file.
Press the <ESC> key.
Editing mode
Text editing.
See list of editing commands below.
Line mode
File saving, opening, etc. Exiting from vi.
From the command mode, type “:” (colon).
When you enter the vi program, you are automatically in command mode. To navigate to the part of the file you wish to edit, use the following keys:
Table 18: vi navigation commands h
Moves the cursor to the left (left arrow).
j
Moves the cursor to the next line (down arrow).
k
Moves the cursor to the previous line (up arrow).
l
Moves the cursor to the right (right arrow).
Having arrived at the location where text should be changed, use these commands to modify the text (note commands “i” and “o” will move you into edit mode and everything typed will be taken literally until you press the <ESC> key to return to the command mode).
User Guide
329
Page 330
Appendix A - New User Background Information Table 19: vi file modification commands i
Inserts text before the cursor position (everything to the right of the cursor is shifted right).
o
Creates a new line below the current line and insert text (all lines are shifted down).
dd
Removes the entire current line.
x
Deletes the letter at the cursor position.
After you have finished modifying a file, enter line mode (by typing “:” from command mode) and use one of the following commands: Table 20: vi line mode commands
330 w
Saves the file (w is for write).
wq
Saves and closes the file (q is for quit).
q!
Closes the file without saving.
w file
Saves the file with the name <file>.
e file
Opens the file named <file>.
Cyclades-TS
Page 331
Appendix A - New User Background Information The Routing Table The Cyclades-TS has a static routing table that can be seen using the commands: route or netstat -rn The file /etc/network/st_routes is the Cyclades-TS’s method for configuring static routes. Routes should be added to the file (which is a script run when the Cyclades-TS is initialized) or at the prompt (for temporary routes) using the following syntax: route [add|del] [-net|-host] target netmask nt_msk [gw gt_way] interf
[add|del]
One of these tags must be present. Routes can be either added or deleted.
[-net|-host]
Net is for routes to a network and -host is for routes to a single host.
target
Target is the IP address of the destination host or network.
netmask nt_msk
The tag netmask and nt_mask are necessary only when subnetting is used, otherwise, a mask appropriate to the target is assumed. nt_msk must be specified in dot notation.
gw gt_way
Specifies a gateway, when applicable. gt_way is the IP address or hostname of the gateway.
interf
The interface to use for this route. Must be specified if a gateway is not. When a gateway is specified, the operating system determines which interface is to be used.
User Guide
331
Page 332
Appendix A - New User Background Information Secure Shell Session Ssh is a command interface and protocol often used by network administrators to connect securely to a remote computer. Ssh replaces its non-secure counterpart rsh and rlogin. There are two versions of the protocol, ssh and ssh2. The Cyclades-TS offers both. The command to start an ssh client session from a UNIX workstation is: ssh -t <user>@<hostname> where <user> = <username>:ttySnn or <username>:socket_port or <username>:ip_addr or <username>:serverfarm Note: “serverfarm” is a physical port alias. It can be configured in the file pslave.conf. An example: username: TS1000 IP address: host name:
cyclades 192.168.160.1 ts1000 servername for port 1: file_server ttyS1 is addressed by IP 10.0.0.1 or socket port 7001. The various ways to access the server connected to the port are: ssh -t cyclades:ttyS1@ts1000 ssh -t cyclades:7001@ts1000 ssh -t cyclades:10.0.0.1@ts1000 ssh -t cyclades:file_server@ts1000
332
Cyclades-TS
Page 333
Appendix A - New User Background Information ssh -t -l cyclades:10.0.0.1ts1000 ssh -t -l cyclades:7001 ts1000 For openssh clients, version 3.1p1 or later ssh2 is the default. In that case, the -1 flag is used for ssh1. ssh -t cyclades:7001@ts1000 (openssh earlier than 3.1p1 - Cyclades-TS V_1.3.1 and earlier -> ssh1 will be used) ssh -t -2 cyclades:7001@ts1000 (openssh earlier than 3.1p1 - Cyclades-TS V_1.3.1 and earlier -> ssh2 will be used) ssh -t cyclades:7001@ts1000 (openssh 3.1p1 or later - Cyclades-TS V_1.3.2 or later/AlterPath Console Server version 2.1.0 or later -> ssh2 will be used) ssh -t -1 cyclades:7001@ts1000 (openssh 3.1p1 or later - Cyclades-TS V_1.3.2 or laterssh1 will be used)
To log in to a port that does not require authentication, the username is not necessary: ssh -t -2 :ttyS1@ts1000 Note: In this case, the file sshd_config must be changed in the following way: PermitRootLogin Yes PermitEmptyPassword Yes
User Guide
333