archive-com.com » COM » T » TECHOTOPIA.COM

Total: 1018

Choose link from "Titles, links and description words view":

Or switch to "Titles and links view".
  • Using the Bash Shell on Red Hat Enterprise Linux 6 - Techotopia
    with names matching certain criteria For example the wildcard character to can be used to simplify the above example cat txt The above command will display the content of all files ending with a txt extension This could be further restricted to any file names beginning with list and ending in txt cat list txt Single character matches may be specified using the character cat list txt File Name and Path Completion Rather than typing in an entire file name or path or using pattern matching to reduce the amount of typing the shell provides a feature called file name completion In order to use filename completion simply enter the first few characters of the file or path name and then press the Esc key twice The shell will then complete the filename for you with the first file or path name in the directory that matches the characters you entered To obtain a list of possible matches press Esc after entering the first few characters Input and Output Redirection As previously mentioned many shell commands output information when executed By default this output goes to a device file called stdout which is essentially the terminal window or console in which the shell is running Conversely the shell takes input from a device file named stdin which by default is the keyboard Output from a command can be redirected from stdout to a physical file on the file system using the character For example to redirect the output from an ls command to a file named files txt the following command would be required ls txt files txt Upon completion files txt will contain the list of files in the current directory Similarly the contents of a file may be fed into a command in place of stdin For example to redirect the contents of a file as input to a command wc l files txt The above command will display the number of lines contained in files txt file It is important to note that redirection operator creates a new file or truncates an existing file when used In order to append to an existing file use the operator ls dat files txt In addition to standard output the shell also provides standard error output using stderr Whilst output from a command is directed to stdout any error messages generated by the command are directed to stderr This means that if stdout is directed to a file error messages will still appear in the terminal This is generally the desired behavior though stderr may also be redirected if desired using the 2 operator ls dkjfnvkjdnf 2 errormsg On completion of the command an error reporting the fact that the file named dkjfnvkjdnf could not be found will be contained in the errormsg file Both stderr and stdout may be redirected to the same file using the operator ls etc dkjfnvkjdnf alloutput On completion of execution the alloutput file will contain both a listing of the contents of the etc

    Original URL path: http://www.techotopia.com/index.php/Using_the_Bash_Shell_on_Red_Hat_Enterprise_Linux_6 (2016-02-13)
    Open archived version from archive


  • Configuring RHEL 6 Runlevels and Services - Techotopia
    configured to automatically launch different collections of services depending on the functionality that is to be provided at that particular level RHEL Runlevels Descriptions As previously outlined RHEL 6 can be booted into one of a number of runlevels The default runlevel to which the system is configured to boot will in turn dictate which services are started Runlevel 0 The halt runlevel This is the runlevel at which the system shuts down For obvious reasons it is unlikely you would want this as your default runlevel Runlevel 1 Causes the system to start up in a single user mode under which only the root user can log in In this mode the system does not start any networking X windowing or multi user services This run level is ideal for system administrators to perform system maintenance or repair activities Runlevel 2 Boots the system into a multi user mode with text based console login capability This runlevel does not however start the network Runlevel 3 Similar to runlevel 2 except that networking services are started This is the most common runlevel for server based systems that do not require any kind of graphical desktop environment Runlevel 4 Undefined runlevel This runlevel can be configured to provide a custom boot state Runlevel 5 Boots the system into a networked multi user state with X Window System capability By default the graphical desktop environment will start at the end of the boot process This is the most common run level for desktop or workstation use Runlevel 6 Reboots the system Another runlevel that for obvious reasons you are unlikely to want as your default Configuring the Default RHEL 6 Runlevel The default runlevel for an RHEL system is defined within the etc inittab file To identify the current default level or change the default to a different setting load this file into an editor keeping in mind that root privileges will be required The relevant section of a sample etc inittab file is as follows Default runlevel The runlevels used by RHS are 0 halt Do NOT set initdefault to this 1 Single user mode 2 Multiuser without NFS The same as 3 if you do not have networking 3 Full multiuser mode 4 unused 5 X11 6 reboot Do NOT set initdefault to this id 3 initdefault The key line in the example above is the initdefault setting id 3 initdefault This tells the init process that the default run level for the system is runlevel 3 To change to a different run level simply change the number to the desired runlevel and save the etc inittab file Changing the Current Runlevel from within a Running RHEL 6 System The current runlevel of a running RHEL system can be changed using the init command combined with the new target runlevel For the sake of an example assume that an RHEL system is currently running at runlevel 3 In order to change to level 5 thereby activating the desktop environment the

    Original URL path: http://www.techotopia.com/index.php/Configuring_RHEL_6_Runlevels_and_Services (2016-02-13)
    Open archived version from archive

  • Managing RHEL 6 Users and Groups - Techotopia
    the RHEL system using the username and password specified As mentioned above it is also possible to add new users from the command line To do so start a terminal window session Applications Accessories Terminal and at the command prompt enter a command similar to the following su useradd home home john john passwd john The above commands will prompt for the root password of your system and the password for the account Once the information has been gathered useradd creates the new account and the home john home directory The useradd command provides a number of different options which can be learned from the man page man useradd Editing the Properties of a User The properties of a user may be changed using the same User Manager tool used to add a user as outlined above Select the System desktop menu and choose Users and Groups from the Administration sub menu to launch the User Manager tool To make changes to the user properties select the user from the list and click on Properties Work through the various screens in the User Properties dialog for the selected user and click on the OK button to apply the changes These screens allow settings such as the expiration date of the account and the number of days before the password must be changed by the user to be configured Deleting a User from an RHEL System An existing user may be deleted using the same User Manager dialog used to add a user as outlined above Select the System desktop menu and choose Users and Groups from the Administration sub menu to launch the User Manager dialog Select the user to be deleted and click on Delete A confirmation dialog will appear providing the option to delete the user s home directory and temporary files If you wish to proceed click on Delete A user account may also be deleted from command line using the userdel utility su userdel john It is also possible to remove the user s home directory and mail spool as part of the deletion process su userdel remove john Adding a New Group to an RHEL 6 System All users are members of one or more groups By default new users are added to a private group with the same name as the user in the above example the account created for user john was a member of a private group also named john As an administrator it makes sense to organize users into more logical groups For example all sales people might belong to a sales group whilst accounting staff might belong to the accounts group and so on New groups are added either using the User Manager graphical tool or by using the groupadd command line tool In this section we will look at both methods To access the User Manager tool select the desktop System menu and choose Users and Groups from the Administration sub menu To administer the group settings click on

    Original URL path: http://www.techotopia.com/index.php/Managing_RHEL_6_Users_and_Groups (2016-02-13)
    Open archived version from archive

  • Basic RHEL 6 Firewall Configuration - Techotopia
    typical users leave this option disabled Note that the FTP server is not installed by default on RHEL 6 Samba The Samba service allows files and printers to be shared between Linux and Windows systems If this traffic is blocked in the firewall it will not be possible to use Samba on this system A more extensive list of services and ports can be found on line at http www techotopia com index php Primary TCP IP Port Assignments and Descriptions To activate or deactivate an option simply click on the check box next to the service Configuring Other Ports The list of well known ports is not of course the only ports available In fact there are thousands of ports available for use by applications and services To open a specific port use the Other ports category of the Firewall Configuration tool To open a port click on the Add button to display the Port and Protocol dialog shown below This dialog provides a far more extensive list of ports Either select the desired port from the list or enter it manually if it is not listed by selecting the User Defined option When manually defining the port both the port number and protocol TCP or UDP will need to be provided to ensure the firewall does not interfere with traffic on that port Configuring Trusted Interfaces A trusted interface is a network adapter either physical or software based on which traffic is known to be coming from a secure network environment For example an RHEL 6 system acting as a firewall for an internal network might contain two network adapters one of which is connected via a gateway or modem to the internet while the other is connected to the secure internal network In such a situation the first adapter would be configured as untrusted since it is exposed to traffic from the outside world Assuming the internal network is protected by the firewall and other intrusion prevention measures the second adapter can be considered to be trustworthy Masquerading Masquerading is better known in networking administration circles as Network Address Translation NAT When using an RHEL 6 system as a gateway to the internet for a network of computers masquerading allows all of the internal systems to use the IP address of the RHEL 6 system when communicating over the internet This has the advantage of hiding the internal IP addresses of any systems from malicious external entities and also avoids the necessity to allocate a public IP address to every computer on the network This service is also provided by most routers and gateways so this feature of the RHEL 6 Firewall is rarely used Port Forwarding Port forwarding is used in conjunction with masquerading when the RHEL 6 system is acting as a gateway to the internet for an internal network of computer systems Port forwarding allows traffic arriving at the firewall via the internet on a specific port to be forwarded to a particular system

    Original URL path: http://www.techotopia.com/index.php/Basic_RHEL_6_Firewall_Configuration (2016-02-13)
    Open archived version from archive

  • Configuring RHEL 6 Printers - Techotopia
    not provided in the Printer configuration dialog select your printer right click with the mouse to pop up the menu and select Properties Click on Print Test Page to send a test page to the printer Adding a Network Printer In addition to printers connected directly to a system RHEL 6 is also able to communicate with network based printers for example a WiFi enabled printer present on the same network as the RHEL 6 system To add a network based printer begin by launching the printer settings tool System Administration Printing When the tool appears click on the New button located in the toolbar and click on the Network Printer heading located in the Devices panel RHEL 6 will list any network printers that have already been detected If your desired network printer is not already listed select the Find Network Printer option and enter the hostname or IP address of either the printer or the system to which the printer is connected before clicking on the Find button If RHEL 6 can locate the printer it will be listed in the Devices panel Once located select the device and click the Forward button to search and install the appropriate driver Once a driver has been installed click Forward once again to provide printer name location and other descriptive details Finally click Apply to add the printer to the system and to print a test page if desired Configuring a Printer Connected to a Windows System If you need to access a printer that is connected to a Windows system you can easily configure RHEL 6 to support this The first step is to visit the Windows system and make sure the printer is shared and ideally find out the share name though the RHEL 6 Printer configuration tool will allow you to browse the Windows network to find available printers if necessary On Windows XP select Printers and Faxes from the Start menu and find your printer Right click on the printer and select Sharing In the properties dialog select Share this printer if it has not already been selected Enter a Share name or note the name if one already exists On Windows 7 select Devices and Printers from the Start menu right click on the printer to be shared and select Printer Properties In the properties dialog select the Sharing tab In the properties dialog select Share this printer if it has not already been selected and Share name or note the name if one already exists On the RHEL 6 system begin by checking that SAMBA traffic is permitted in the Firewall settings System Administration Firewall Next invoke the Printer configuration dialog System Administration Printing click on the New button in the toolbar and select Windows Printer via SAMBA to display the following configuration panel If you already know the workgroup computer name and printer share name of the device to be accessed enter this information using the following syntax workgroup server port sharename Note

    Original URL path: http://www.techotopia.com/index.php/Configuring_RHEL_6_Printers (2016-02-13)
    Open archived version from archive

  • Remote Access to the RHEL 6 Desktop - Techotopia
    toolbar and exit the firewall tool Accessing a Remote RHEL Desktop using vncviewer Remote desktop access from other Linux based systems can be achieved using the vncviewer tool This tool is contained within a package named vnc which may be installed on RHEL using the following command sequence in a terminal window su yum install vnc The vncviewer tool is available for a wide range of operating systems and a quick internet search will likely provide numerous links providing details on how to obtain and install this tool on your chosen platform To access a remote desktop using vncviewer execute the following command in a terminal window vncviewer hostname 0 google RHEL6BOX google where hostname is either the hostname or IP address of the remote system Alternatively run the command without any options to be prompted for the details of the remote server If you configured the remote system to prompt to approve a connection a dialog will appear on the remote system Until the connection is approved the vncviewer session will wait Once approved or if no approval is required VNC will prompt for the password assuming one was defined If you see a message similar to the following then you may need to use the secure method of remote desktop display outlined in the next section main unable to connect to host No route to host 113 Otherwise enter the password and a new screen will appear containing the desktop from the remote system Note that if the remote desktop is configured to prompt you before allowing remote access you will need to accept the connection on the remote system before the desktop will appear in the viewer If remote desktop control was enabled you can interact with the desktop as if you were sitting at the remote screen This section assumed that the remote desktop was being accessed from a Linux or UNIX system Access is also possible from a Windows system Accessing a Remote RHEL Desktop from a Windows System In order to access an RHEL remote desktop from a Windows system the first step is to install a Windows VNC client on the Windows system There are a number of VNC packages available for Windows In this chapter we will look at using TightVNC http www tightvnc com Download and install TightVNC on your Windows system Once installed launch the TightVNC Viewer and in the resulting Connection details dialog enter the IP address or hostname of the remote system and press OK Enter the password if one is required The screen should load and display the remote desktop You may also enter the port number in the form hostname 5900 screen 0 in VNC uses port 5900 TightVNC assumes port 5900 if none is specified but when we look at setting up additional desktops later in this chapter we will need to specify port numbers in order to connect Establishing a Secure Remote Desktop Session The remote desktop configurations we have explored so far in

    Original URL path: http://www.techotopia.com/index.php/Remote_Access_to_the_RHEL_6_Desktop (2016-02-13)
    Open archived version from archive

  • Configuring RHEL 6 Remote Access using SSH - Techotopia
    running it can be started from the command line sbin service sshd start The service may also be started by using the GUI Service Configuration tool accessed via the System Administration Services menu option Once the tool has loaded simply scroll down the list of services until you reach sshd Select it and click on the Start button located in the toolbar Configuring the RHEL Firewall to Allow SSH Connections If you are using a firewall to protect your RHEL system you may need to allow SSH connections before you will be able to connect from a remote system If you are using the basic firewall configuration see Basic RHEL 6 Firewall Configuration you can allow SSH connections using the Security Level and Firewall Configuration tool This tool is launched from the System Administration Firewall menu option as appears as follows If the box next to SSH is not already checked check it and click Apply to allow ssh traffic to pass through the firewall Using SSH on RHEL SSH can be used to log into your system from a remote system It is also possible to test that the SSH server is running and accessible from the local machine SSH connections are established using the ssh client utility To connect from your local machine back to itself use the following command ssh l username ipaddresss Where username is the name of the user you wish to log in as and ipaddress is the IP address of your system You can also substitute the hostname of the system in place of the IP address If you do not know the IP address run the ifconfig command in a terminal window This will output information similar to eth0 Link encap Ethernet HWaddr 00 13 72 0B 14 57 inet addr 192 168 2 21 Bcast 192 168 2 255 Mask 255 255 255 0 inet6 addr fe80 213 72ff fe0b 1457 64 Scope Link UP BROADCAST RUNNING MULTICAST MTU 1500 Metric 1 RX packets 4261067 errors 0 dropped 0 overruns 0 frame 0 TX packets 4409081 errors 0 dropped 0 overruns 0 carrier 0 collisions 0 txqueuelen 100 RX bytes 2068332349 1 9 GiB TX bytes 2408187471 2 2 GiB Base address 0xcce0 Memory fe3e0000 fe400000 In the above output the IP address is shown as inet addr in this case 192 168 2 21 To connect from a remote system perform the same steps above using either the IP address or host name of the remote host to which you wish to connect Enter your password when prompted and you will find yourself logged into the remote system Copying files using SSH The SSH service provides a mechanism for securely copying files to and from a remote system Copying is performed using the scp utility To copy a file to a directory on a remote system execute the following command scp myfile txt email protected home demo Where myfile txt is the name of the file to be uploaded to

    Original URL path: http://www.techotopia.com/index.php/Configuring_RHEL_6_Remote_Access_using_SSH (2016-02-13)
    Open archived version from archive

  • Using NFS to Share RHEL 6 Folders with Remote Linux and UNIX Systems - Techotopia
    3614 3613 3612 3611 3610 3609 3608 3607 is running rpc rquotad pid 3601 is running If the service is not running invoke it using the following command sbin service nfs start Configuring the RHEL 6 Firewall to Allow NFS Traffic Next the firewall needs to be configured to allow NFS traffic To achieve this run the Firewall Configuration tool by selecting the System Administration Firewall menu option If the firewall is enabled make sure that the check box next to NFS4 is set and then click on Apply and OK Specifying the Folders to be Shared Now that NFS is running and the firewall has been configured we need to specify which parts of the RHEL 6 file system may be accessed by remote Linux or UNIX systems Whilst previous versions of RHEL included a graphical tool called system config nfs unfortunately this tool has been removed in RHEL 6 The good news is that this task can still be easily achieved by manually editing the appropriate configuration file The file that needs to be edited is etc exports which will need to be created and modified to export directories for access by remote systems via NFS The syntax for an export line in this file is as follows export host1 options host2 options In the above line export is replaced by the directory to be exported host1 is the name or IP address of the system to which access is being granted and options represents the restrictions that are to be imposed on that access read only read write etc Multiple host and options entries may be placed on the same line if required For example the following line grants read only permission to datafiles to a host with the IP address of 192 168 2 38 datafiles 192 168 2 38 ro The use of wildcards in permitted in order to apply an export to multiple hosts For example the following line permits read write access to home demo to all external hosts home demo rw A full list of options supported by the exports file may be found by reading the exports man page man exports For the purposes of this chapter we will configure the etc exports file as follows tmp rw sync vol1 192 168 2 21 ro sync Once configured the directories must first be exported using the exportfs command usr sbin exportfs a It is also possible to view the current share settings from the command line using the exportfs tool usr sbin exportfs The above command will generate the following output vol1 192 168 2 21 tmp world Accessing Shared RHEL 6 Folders The shared folders may be accessed from a remote system either by mounting them manually from the command line or browsing to them using the Nautilus File Browser Keep in mind that it may also be necessary to configure the firewall on the remote system to allow NFS traffic To mount a remote folder from the command line

    Original URL path: http://www.techotopia.com/index.php/Using_NFS_to_Share_RHEL_6_Folders_with_Remote_Linux_and_UNIX_Systems (2016-02-13)
    Open archived version from archive



  •