Service Name NetFS Description NetFS is a boot-time script used to mount or unmount Network File System (NFS), Samba (SMB/CIFS), and Netware (NCP) file systems. The script is run once at boot time to scan for network-related file system mounts: nfs, smb, cifs, or ncp types. Service administration To view the options available for administrating […]
Archives for November 2017
How to use variables in shell scripts
A variable is simply a placeholder for some value. The value can change; however, the variable name will always be the same. Shell variables are capitalized by convention. The shell maintains two lists of variables: 1. Those local to the current shell 2. Those global to all shells (environment variables). Use the set and env […]
How to debug shell scripts
When a script does not work properly, we need to determine the location of the problem. The UNIX/Linux shells provide a debugging mode. Run the entire script in debug mode or just a portion of the script. To run an entire script in debug mode, add -x after the #!/bin/[shell] on the first line: For […]
UNIX / Linux : What Is a Shell? What are different Shells?
What Is a Shell? A shell is a program that provides an interface between a user and an operating system (OS) kernel. An OS starts a shell for each user when the user logs in or opens a terminal or console window. A kernel is a program that: Controls all computer operations. Coordinates all executing […]
Understanding rsyslog Templates
Templates modify and format output generated by rsyslog. They allow to specify any format a user might want. They are also used for dynamic file name generation. The following is the syntax to create a template: $template TEMPLATE_NAME,”text %PROPERTY% text”, [OPTION] The fields are described as follows: Field Purpose $template Directive that defines a template […]
CentOS / RHEL : How to Set up SFTP to Chroot Jail only for Specific Group
In order to allow ChrootDirectory functionality on a per-user basis, employ a conditionally-executed sshd configuration (using the “Match” keyword) in the sshd_config file. Setting ChrootDirectory on a specific Group, ensures that the users of that group can’t get out of their home directory, in turn ensuring no other users are affected. 1. Create a group […]
CentOS / RHEL : How to set chroot jail for vsftp only for specific users
How to set up sftp so that a user can’t get out of their home directory, ensuring no other users are affected? Well, there is an easy way of doing it. We can chroot either all the local users to default $HOME directory or do it only for a specific users. This post specificly lists […]
CentOS / RHEL : How to set chroot jail for vsftp for all the users
Under default VSFTP configuration, VSFTP login users can navigate to top-level directories which might cause security issues. There are situations when you do not wish FTP users to be able to access any files outside of their own home directory. The vsftp daemon can be chrooted to implement this policy. Set chroot jail to default […]
CentOS / RHEL : How to set up chroot jail SFTP
chrooting sftp is a feature provided by the OpenSSH package in Linux. You can set up a chroot environment to avoid unwanted alterations of the system including uploads in unwanted locations when users are making use of sftp. When you chroot sftp for a specific user or all the users, the users can only access […]
How to Use the ssh-keygen Command to configure passwordless ssh
Use the ssh-keygen command to generate a public/private authentication key pair. Authentication keys allow a user to connect to a remote system without supplying a password. Keys must be generated for each user separately. If you generate key pairs as the root user, only the root can use the keys. Generating keys and configuring passwordless […]