The next big thing about Raspberry Pi is here, where there is much more computer power and more. The Raspberry Pi Foundation announced on Monday that there is a Raspberry Pi 4, an all-encompassing innovation that touches almost all elements of the computer platform. Raspberry Pi 4 offers users a choice of three storage capacities. The entry-level 1 GB RAM retains the US $ 35 signature; 2 GB costs $ 45; 4 GB sells for $ 55. Prices exclude sales tax, import duty (if applicable) and shipping. All three options were launched on Monday. The foundation built more 2 GB variants than others and adjusts the mix over time to meet the demands. The upgrade for version 4 gives PC-like performance for the first time while retaining the Raspberry Pi class interface and hacking, according to Eben Upton, founder and CEO of Raspberry Pi Trading.
Restricted users are made to run only specific commands allowed by the administrator to execute in terminal. So in order to restrict user following is the procedure.
Step 1: Copy bash shell
Copy bash shell from /bin/bash and paste it as new restricted bash shell.
# cp /bin/bash /bin/rbash
# chmod o+x /bin/rbash
Step 2: Create rbash shell user
# useradd -s /bin/rbash testuser
# mkdir /home/testuser/commands
# passwd testuser
# chown testuser:testuser /home/testuser/commands/
Step 3: Assign specific commands
# cp /usr/bin/free /home/testuser/commands/
# cp /usr/bin/grep /home/testuser/commands/
# chmod 755 /home/testuser/commands/free
# chmod 755 /home/testuser/commands/top
Step 4: Update user profile
# cd ~testuser/
# vi .bash_profile
Repository is database of application installation and up-gradation of packages which are available on different Linux distributions. The packages of distros are available on official websites or you can extract them from official CD/DVD. We can easily install, upgrade or delete packages from repository.
Step 1: Mount ISO from DVD or Folder
# cd /root # mount -o loop RHEL-7.0 Server.x86_64-dvd.iso /mnt/ (For Redhat 7) # mount -r -t iso9660 -o loop -v rhel-server-6.4-x86_64-dvd.iso /mnt (For Redhat 6)
Step 2: Create Repository
To create repository follow the following steps.
# cd /etc/yum.repos.d/ # vi rhel7.repo [rhel7] name=Redhat baseurl=file:///mnt/ enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
Step 3: Install Packages
Install Packages using yum command.
# yum clean all # yum install ftp httpd gcc
If you forgot your root password, then it’s not a big deal. Below are the methods to reset root password in different linux distributions.
Step 1: Power on Redat/CentOS 7 Server
First power on your Redhat/CentOS 7 server. At the boot menu, select the Kernel you want to boot up and press e to edit the selected boot entry.
Find the line rhgb quiet :
and replace it with init=/bin/bash
Then press CTRL+X to enter into single user mode.
Step 2: Mount / partition
# mount -o remount,rw /
Step 3: Change root password
# passwd root
Step 4: Create File
# touch /.autorelabel
Step 5: Execute Command
# exec /sbin/init
Dnsmasq is a lightweight DNS forwarder and resource constrained routers and firewalls. It is widely used for tethering on smartphones and portable hotspots, and to support virtual networking in virtualisation frameworks. Dnsmasq is included in most Linux distributions like FreeBSD, OpenBSD and NetBSD.
Step 1: Install dnsmasq
First install dnsmasq package using yum command.
# yum -y install dnsmasq
Step 2: Configuration
Configure dnsmasq service as per following settings.
# vi /etc/dnsmasq.conf # line 19: uncomment (never forward plain names) domain-needed # line 21: uncomment (never forward addresses in the non-routed address spaces) bogus-priv # line 41: uncomment (query with each server strictly in the order in resolv.conf) strict-order # line 55: add if you need # query the specific domain name to the specific DNS server # the example follows means query [server.education] domain to the [10.0.0.10] server server=/server.education/10.0.0.10 # line 123: uncomment (add domain name automatically) expand-hosts # line 133: add (define domain name) domain=tecdistro
Step 3: Start Service
Run the DHCP service by using below command and start service.
# systemctl start dnsmasq # systemctl enable dnsmasq
Step 4: Entry in hosts file
# vi /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 # add records 10.0.0.30 dlp.tecdistro dlp
Restart the dnsmasq service.
# systemctl restart dnsmasq
Step 5: Add service in firewall
# firewall-cmd --add-service=dns --permanent success # firewall-cmd --reload success
Wifi security breaches when the research and development team scanned 32 WiFi router firmware firmware products offered by more than 10 of the most popular home, SMB and enterprise wireless routers in the US, Europe and Asia Manufacturer: Asus, Belkin, Buffalo, Cisco, D-Link, EFM, Huawei, Linksys, Netis and TP-Link.
The firmware of the WiFi router sold by the top vendors included versions of open source components with vulnerabilities specified in the binary scans. The firmware of most models contained security holes “Severity High” and “Severity Middle”. This means that deployed products and firmware updates remain vulnerable to potential security threats.
The entire firmware uses Busybox and Samba by default, as the report shows. More than 60 percent used OpenSSL. Significant security issues arise from OpenSSL. This should prompt vendors to consistently use the latest patches or use the version of the software that contains the fix, the researchers said. Much of the firmware did not use the correct, most recent versions of OSS components available, the study found.
File Transfer Protocol(FTP) is a network protocol used for the transfer of files between a client and server on network.
Step 1: Create User
First create FTP user by using following method.
# useradd test # passwd test
Step 2: Create FTP user Directory
Make a directory in ftpdata folder
# cd /ftpdata/ # ls -l # mkdir test # chown test:staff test
Step 3: How to assign quota for FTP User in Solaris
In order to assign quota to FTP user below is the method.
# zfs create ftpdata/test # zfs set quota=50M ftpdata/test
Thanks, all done 🙂
In this article we will see basic commands to check the physical memory on the server under Linux. Many beginners struggle to know their system well in the context of resources such as CPU, Memory, Disks, etc. So I decided to write this small item pointing command to check the RAM on the Linux server. These commands will work in different flavors of Linux like Red Hat, CentOS, Suse, Ubuntu, Fedora, Debian etc.
1) Using free command
This command is mainly used to check the RAM and SWAP on the system. Using a different change, you can change the output byte format. Like -b for bytes, -k for kilobytes, -m for megabytes, and -g for gigabytes.
# free -b total used free shared buff/cache available Mem: 3976634368 3096838144 187990016 51572736 691806208 540106752 Swap: 4001361920 8826880 3992535040 # free -k total used free shared buff/cache available Mem: 3883432 3024204 183600 50364 675628 527488 Swap: 3907580 8620 3898960 # free -m total used free shared buff/cache available Mem: 3792 2953 179 49 659 515 Swap: 3815 8 3807 # free -g total used free shared buff/cache available Mem: 3 2 0 0 0 0 Swap: 3 0 3
2) Using /proc/meminfo file
# cat /proc/meminfo |grep Mem MemTotal: 3883432 kB MemFree: 183268 kB MemAvailable: 527276 kB
3) Using top command
# top top - 12:36:36 up 8 days, 2:58, 2 users, load average: 0.14, 0.14, 0.08 Tasks: 213 total, 1 running, 212 sleeping, 0 stopped, 0 zombie %Cpu(s): 0.2 us, 0.7 sy, 0.0 ni, 99.0 id, 0.2 wa, 0.0 hi, 0.0 si, 0.0 st KiB Mem : 3883432 total, 182356 free, 3025080 used, 675996 buff/cache KiB Swap: 3907580 total, 3898960 free, 8620 used. 526608 avail Mem PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 2303 root 20 0 2378464 541076 7692 S 1.0 13.9 417:16.56 OpsCenterDBd
4) Using vmstat
[root@opscenter ~]# vmstat -s 3883432 K total memory 3025552 K used memory 2439780 K active memory 870348 K inactive memory 181812 K free memory 138712 K buffer memory 537356 K swap cache 3907580 K total swap 8620 K used swap 3898960 K free swap 2323674 non-nice user cpu ticks 2978 nice user cpu ticks 944914 system cpu ticks 135133743 idle cpu ticks 692582 IO-wait cpu ticks 121 IRQ cpu ticks 49623 softirq cpu ticks 0 stolen cpu ticks 1931906 pages paged in 23034525 pages paged out 377 pages swapped in 2353 pages swapped out 956323695 interrupts 2040196891 CPU context switches 1505191059 boot time 849343 forks
SNMP stands for Simple Network Management Protocol. It is a protocol used to monitor servers. It is used for collecting information from, and configuring, network devices, such as servers, printers, hubs, switches, and routers on an Internet Protocol (IP) network.\
Step 1: Install SNMP
# yum install -y net-snmp net-snmp-utils
# cd /etc/snmp # cp -p snmpd.conf snmpd.conf.dist # echo "rocommunity public">snmpd.conf # echo "syslocation here" >>snmpd.conf # echo "syscontact root@localhost" >>snmpd.conf
# systemctl enable snmpd && systemctl start snmpd
# snmpwalk -v 1 -c public -O e 127.0.0.1 SNMPv2-MIB::sysDescr.0 = STRING: Linux rhel7.example.com 3.10.0-54.0.1.el7.x86_64 #1 SMP Tue Nov 26 16:51:22 EST 2013 x86_64 SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10 ...
Step 1: Introduction
The utmpx and wtmpx files are extended database files that have superseded the obsolete utmp and wtmp database files.
The utmpx database contains user access and accounting information for commands such as who(1), write(1), and login(1). The wtmpx database contains the history of user access and accounting information for the utmpx database.
Step 2: Create Backup of wtmpx
In order to create a backup of wtmpx first check the disk space in /tmp and then copy the file in /tmp directory
# /usr/lib/acct/fwtmp < /var/adm/wtmpx > /tmp/wtmpx.orig
Step 3: Empty wtmpx file
To empty wtmpx file us the following command
# cat /dev/null > /var/adm/wtmpx
Step 4: Zip original wtmpx file
Create a zip of original wtmpx file using gzip command
# gzip /tmp/wtmpx.orig
Step 5: Copy original wtmpx
Copy original wtmpx file in /var/adm/ for audit purpose
# cp /tmp/wtmpx.orig.gz /var/adm/
TecDistro is a learning based website in which there are many helpful Linux/Unix based articles and tutorials for beginners. It’s a platform where we help Linux/Unix system administrator that how to become a good system administrator. The goal is to give the better solution and guide for system administrator to make the things easy.