Author Archives: Menaka De Alwis

Unknown's avatar

About Menaka De Alwis

I, Menaka De Alwis, am a Linux enthusiast who loves working with open source technologies. I strongly believe in sharing knowledge that I have gained through my education and experience.

Samba Server and Clients

Samba is a open-source software that can be used on both Windows and Linux for sharing files, folders, and printers between them. It has been used for many years with several different protocols (SMB/CIFS protocol), as well as their subcategories.

  • Let’s install samba server, client and policycoreutils for SELinux

[admin@localhost ~]$ sudo dnf install samba samba-client policycoreutils-python-utils

  • Create sambashare directory in under “ / “ as follows give necessary permission.

sudo mkdir /sambashare

sudo chmod -R 777 sambashare/

  • Check the SELinux boolean for samba and enable them if they are not enable.

[admin@localhost ~]$ getsebool -a | grep samba_export

samba_export_all_ro –> off

samba_export_all_rw –> off

[admin@localhost ~]$ getsebool -a | grep samba_share_nfs

samba_share_nfs –> off

[admin@localhost ~]$ sudo setsebool -P samba_export_all_ro=1 samba_export_all_rw=1 samba_share_nfs=1

[admin@localhost ~]$ getsebool -a | grep samba_export

samba_export_all_ro –> on

samba_export_all_rw –> on

[admin@localhost ~]$ getsebool -a | grep samba_share_nfs

samba_share_nfs –> on

  • Add approriate SELinux context for sambashare folder.

[admin@localhost ~]$ sudo semanage fcontext -at samba_share_t “/sambashare/(/.*)?”

[admin@localhost ~]$ restorecon /sambashare/

[admin@localhost ~]$ ll -Zd /sambashare/

drwxr-xr-x. 2 root root unconfined_u:object_r:default_t:s0 4096 Jul 6 21:44 /sambashare/

  • Allow the Samba Service via Firewall

[admin@localhost ~]$ sudo firewall-cmd –permanent –add-service=samba

[sudo] password for admin:

success

[admin@localhost ~]$ sudo firewall-cmd –reload

success

  • Test the Samba Configuration settings.

[admin@localhost ~]$ testparm

Load smb config files from /etc/samba/smb.conf

Loaded services file OK.

Weak crypto is allowed

Server role: ROLE_STANDALONE

Press enter to see a dump of your service definitions

# Global parameters

[global]

interfaces = lo enp0s4 192.168.1.

log file = /var/log/samba/%m.log

security = USER

server string = 192.168.1.123

workgroup = SAMBA

idmap config * : backend = tdb

hosts allow = 127. 192.168.1.124

[sambashare]

comment = /sambashare

guest ok = Yes

path = /sambashare

read only = No

valid users = user1

write list = user1

  • Create Samba user and password

[admin@localhost ~]$ sudo useradd user1

[sudo] password for admin:

[admin@localhost ~]$ sudo smbpasswd -a user1

New SMB password:

Retype new SMB password:

Added user user1.

  • The “pdbedit” program is used to manage the user’s accounts stored in the “sam” database and can be run only by root.

[admin@localhost ~]$ sudo pdbedit -Lv

Unix username: user1

NT username:

Account Flags: [U ]

User SID: S-1-5-21-732476358-3035687843-3070369674-1000

Primary Group SID: S-1-5-21-732476358-3035687843-3070369674-513

Full Name:

Home Directory: \\localhost\user1

HomeDir Drive:

Logon Script:

Profile Path: \\localhost\user1\profile

Domain: LOCALHOST

Account desc:

Workstations:

Munged dial:

Logon time: 0

Logoff time: Wed, 06 Feb 2036 15:06:39 GMT

Kickoff time: Wed, 06 Feb 2036 15:06:39 GMT

Password last set: Tue, 07 Jul 2020 00:16:25 BST

Password can change: Tue, 07 Jul 2020 00:16:25 BST

Password must change: never

Last bad password : 0

Bad password count : 0

Logon hours : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

[admin@localhost ~]$

  • Enable and start the samba service

[admin@localhost ~]$ sudo systemctl start/enable smb

[admin@localhost ~]$ sudo systemctl status smb

● smb.service – Samba SMB Daemon

Loaded: loaded (/usr/lib/systemd/system/smb.service; disabled; vendor preset: disabled)

Active: active (running) since Tue 2020-07-07 00:20:11 BST; 9s ago

Samba Client on Linux

  • Installing Samba Client

[root@localhost ]# dnf install samba samba-client cifs-utils

  • Mount sambashare folder in Samba Server with /mnt

[root@localhost ~]# mount //192.168.1.123/sambashare /mnt –verbose -o user=user1,pass=123456

mount.cifs kernel mount options: ip=192.168.1.123,unc=\\192.168.1.123\sambashare,user=user1,pass=********

[root@localhost ~]# df -h

Filesystem Size Used Avail Use% Mounted on
devtmpfs 1.9G 0 1.9G 0% /dev
tmpfs 1.9G 17M 1.9G 1% /run
tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
/dev/sda3 6.1G 1.4G 4.4G 25% /
tmpfs 378M 0 378M 0% /run/user/0
//192.168.1.123/sambashare 6.1G 1.8G 4.4G 29% /mnt
  • Samba server auto mount (with credential file)

[root@localhost ~]# vi /etc/samba/sharecred

user=user1

pass=123456

[root@localhost ~]# vi /etc/fstab

UUID=13eb116b-abb0-4d7e-895a-fd5bee45cc30 swap swap defaults 0 0

//192.168.1.123/sambashare /mnt cifs rw,credentials=/etc/samba/sharecred 1 1

  • Mount the above share as below

[root@localhost ~]# mount -a

[root@localhost ~]# df -h

Filesystem Size Used Avail Use% Mounted on
devtmpfs 1.9G 0 1.9G 0% /dev
tmpfs 1.9G 17M 1.9G 1% /run
tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
/dev/sda3 6.1G 1.4G 4.4G 25% /
tmpfs 378M 0 378M 0% /run/user/0
/dev/sda1 976M 133M 777M 15% /boot
//192.168.1.123/sambashare 6.1G 1.8G 4.3G 29% /mnt

Samba Client on Windows

  • Add samba window client into smb.conf file as follows. It has IP address of 192.168.1.106.

[admin@localhost ~]$ sudo vi /etc/samba/smb.conf

  • Then enter the samba server (with IP 192.168.1.123) for search as follows.
  • Now enter the samba username and password to login to samba server

Configure the SSH via None Default Port

Here, we are going to set port 22 to the default port, 3456 for ssh communication. First, we’ll need to install “poliycoreutils-python” package to adjust the SELinux context.

  • Let’s get start with installation of “Policycoreutils-python”

[root@Server ~]# dnf install policycoreutils-python-utils

  • Configuring “/etc/ssh/sshd_config” file for none default port of 3456.

[root@Server ~]# vi /etc/ssh/sshd_config

Port 3456

#AddressFamily any

#ListenAddress 0.0.0.0

#ListenAddress ::

HostKey /etc/ssh/ssh_host_rsa_key

HostKey /etc/ssh/ssh_host_ecdsa_key

HostKey /etc/ssh/ssh_host_ed25519_key

  • Now, let’s do the SELinux port configuration.

[root@Server ~]# semanage port -a -t ssh_port_t -p tcp 3456

  • Adjust the firewall-cmd

[root@Server ~]# firewall-cmd –permanent –add-port=3456/tcp

success

[root@Server ~]# firewall-cmd –reload

success

  • Restart the sshd service

[root@Server ~]# systemctl restart sshd

  • Remote machine connection via none default port of 3456

SFTP File Transfer

For SFTP file transfer, we won’t need to install any packages because the SFTP client is installed by default with the installation. This program allows for a quick and easy method to transfer files on Linux. You can use the following command to identify the related packages.

[root@Server ~]# rpm -qf $(which sftp)

openssh-clients-8.0p1-4.el8_1.x86_64

  • Connecting to remote PC

[root@Server ~]# sftp root@192.168.1.121

root@192.168.1.121’s password:

Connected to root@192.168.1.121.

sftp>

  • List the files and folders in Remote PC

sftp> ls

anaconda-ks.cfg file_client.txt original-ks.cfg

sftp>

  • File transfer from remote PC to Local PC,we use “get” command. (Getting files from remote PC to Local (Downloading))
  • File transfer from Local PC to Remote PC we use “put” command. (Putting files to remote PC (upload the file))
  • Display statistics for current directory or filesystem containing ‘path’
  • Some of the help options
  • SFTP is possible via default ports, but they have to be pre-configured beforehand. (port 212)

[root@Server ~]# sftp -P 212 root@192.168.1.121

root@192.168.1.121’s password:

Connected to root@192.168.1.121.

sftp>

  • WinSCP is an open source free SFTP client for Windows. You can get it from WinSCP download page. Latest stable WinSCP version is 5.17.6.

https://winscp.net/download/WinSCP-5.17.6-Setup.exe

NFS Server setup on CentOS 8

A Network File System (NFS) is a distributed file system that can access a network on multiple platforms. With NFS, we can mount remote directories onto our systems and work with the files on the remote machine as if they were local files. An NFS protocol is not encrypted by default, and unlike Samba, it does not provide user authentication. Access to the server is restricted by the clients’ IP addresses or hostnames.

  • Creating two directories

[root@localhost ~]# mkdir -p /var/nfs/{HD1,HD2}

[root@localhost ~]# ls -l /var/nfs/

total 8

drwxr-xr-x. 2 root root 4096 Jul 5 14:54 HD1

drwxr-xr-x. 2 root root 4096 Jul 5 14:54 HD2

  • Install of NFS utils

[root@localhost ~]# dnf install nfs-utils

  • Configuure Selinux
  • Configure the firewall
  • Configure “/etc/exports” file

[root@localhost ~]# vi /etc/exports

Mount directory in NFS ServerMount with any clientMount with 192.168.1.122
/var/nfs/HD1*(rw,no_root_squash)192.168.1.122(rw,no_root_squash)
/var/nfs/HD2*(sync)192.168.1.122(sync)

rw – allows both read and write access on the file system.

sync – tells the NFS server to write operations (writing information to the disk) when requested (applies by default).

all_squash – maps all UIDs and GIDs from client requests to the anonymous user.

no_all_squash – used to map all UIDs and GIDs from client requests to identical UIDs and GIDs on the NFS server.

root_squash – maps requests from root user or UID/GID 0 from the client to the anonymous UID/GID.

  • Enable and start rpcbind and nfs-server services.

[root@localhost ~]# systemctl start rpcbind

[root@localhost ~]# systemctl status rpcbind

● rpcbind.service – RPC Bind

Loaded: loaded (/usr/lib/systemd/system/rpcbind.service; enabled; vendor preset: enabled)

Active: active (running) since Sun 2020-07-05 15:32:54 BST; 11s ago

[root@localhost ~]# systemctl status nfs-server

● nfs-server.service – NFS server and services

Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; disabled; vendor preset: disabled)

Active: active (exited) since Sun 2020-07-05 15:33:31 BST; 7s ago

  • Export Directories

[root@localhost ~]# exportfs -var

exporting *:/var/nfs/HD2

exporting *:/var/nfs/HD1

Configure NFS client

  • Installation

[root@localhost ~]# dnf install nfs-utils

  • Enable and start rpcbind and nfs-server services.

[root@localhost ~]# systemctl start rpcbind
[root@localhost ~]# systemctl status rpcbind

[root@localhost ~]# mkdir -p /mnt/{Disk1,Disk2}

[root@localhost ~]# vi /etc/fstab

UUID=e0c30f93-10da-4e89-8024-107ca98298cb swap swap defaults 0 0

192.168.1.122:/var/nfs/HD1 /mnt/Disk1 nfs defaults 0 0

192.168.1.122:/var/nfs/HD2 /mnt/Disk2 nfs defaults 0 0

IP forwarding on CenOS 8

IP forwarding or IP routing is a process that decides where data packets or datagrams have to be delivered. The process uses routing information to make decisions, and it’s designed to send packets over multiple networks. Generally, networks are separated by routers.

In this setup, we have three machines. One is for the DHCP server, the other one is for routing configured and the last one is for the client. All those machines are in the same VLAN with the subnet 172.168.30.0.

First of all, let’s install the following packages to help all of the processes run smoothly.

[root@localhost]# dnf install -y net-tools bind-utils nc

  • Now, let’s configure Network adapters of routing enable machine. (enp0s3, enp0s8)

cd /etc/sysconfig/network-scripts/

[root@localhost network-scripts]# vi ifcfg-enp0s3 (Connecting to outside gateway)

# Generated by dracut initrd

NAME=enp0s3

DEVICE=enp0s3

ONBOOT=yes

NETBOOT=yes

IPV6INIT=yes

BOOTPROTO=dhcp

TYPE=Ethernet

ZONE=external

PROXY_METHOD=none

BROWSER_ONLY=no

DEFROUTE=yes

IPV4_FAILURE_FATAL=no

IPV6_AUTOCONF=yes

IPV6_DEFROUTE=yes

IPV6_FAILURE_FATAL=no

UUID=3c36b8c2-334b-57c7-91b6-4401f3489c69

[root@localhost network-scripts]#cp ifcfg-enp0s3 ifcfg-enp0s8

[root@localhost network-scripts]# vi ifcfg-enp0s8 (Connecting to virtual LAN :-LAN 100)

# Generated by dracut initrd

NAME=”enp0s8″

DEVICE=”enp0s8″

ONBOOT=yes

NETBOOT=yes

IPV6INIT=yes

BOOTPROTO=static

TYPE=Ethernet

IPADDR=172.168.30.1

NETMASK=225.255.255.0

DNS1=8.8.8.8

DNS2=8.8.4.4

ZONE=internal

  • Configure IP forwading

[root@localhost ~]#vi /etc/sysctl.conf

# sysctl settings are defined through files in

# /usr/lib/sysctl.d/, /run/sysctl.d/, and /etc/sysctl.d/.

# Vendors settings live in /usr/lib/sysctl.d/.

# To override a whole file, create a new file with the same in

# /etc/sysctl.d/ and put new settings there. To override

# only specific settings, add a file with a lexically later

# name in /etc/sysctl.d/ and put new settings there.

# For more information, see sysctl.conf(5) and sysctl.d(5).

net.ipv4.ip_forward=1

[root@localhost ~]# vi /etc/sysctl.d/99-sysctl.conf

# sysctl settings are defined through files in

# /usr/lib/sysctl.d/, /run/sysctl.d/, and /etc/sysctl.d/.

# Vendors settings live in /usr/lib/sysctl.d/.

# To override a whole file, create a new file with the same in

# /etc/sysctl.d/ and put new settings there. To override

# only specific settings, add a file with a lexically later

# name in /etc/sysctl.d/ and put new settings there.

# For more information, see sysctl.conf(5) and sysctl.d(5).

net.ipv4.ip_forward=1

Checking IP forwarding configuration variable.

[root@localhost ~]# sysctl -p

net.ipv4.ip_forward = 1

Or

[root@localhost ~]# cat /proc/sys/net/ipv4/ip_forward

1

[root@localhost ~]# systemctl restart NetworkManager

  • Firewall Configuration

[root@localhost ~]# systemctl status firewalld

● firewalld.service – firewalld – dynamic firewall daemon

Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)

Active: active (running) since Wed 2020-07-01 16:53:04 BST; 2h 4min ago

firewall-cmd –change-interface=enp0s3 –zone=external –permanent

firewall-cmd –set-default-zone=internal

firewall-cmd –direct –permanent –add-rule ipv4 nat POSTROUTING 0 -o enp0s3 -j MASQUERADE

firewall-cmd –direct –permanent –add-rule ipv4 filter FORWARD 0 -i enp0s8 -o enp0s3 -j ACCEPT

firewall-cmd –direct –permanent –add-rule ipv4 filter FORWARD 0 -i enp0s3 -o enp0s8 -m state –state RELATED,ESTABLISHED -j ACCEPT

firewall-cmd –reload

The client machine does not have any configuration – it is just set up to accept the DHCP IP address. However, it is capable of accessing the internet via a routing machine (as mentioned below).

Reference

  • IP Subnet calculator.

http://www.subnet-calculator.com

DHCP Server on CentOS 8

DHCP (Dynamic Host Configuration Protocol) Server can automatically assign a previously defined IP addresse to the devices attached on a Local Area Network(LAN). Let’s see how we can set up a DHCP server.

Step 1 Installation

[root@localhost ~]# dnf install dhcp-server

Step 2 Configure the Network Adapter

[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-enp0s8

# Generated by dracut initrd

NAME=”enp0s8″

DEVICE=”enp0s8″

ONBOOT=yes

NETBOOT=yes

IPV6INIT=yes

BOOTPROTO=static

TYPE=Ethernet

IPADDR=172.168.10.1

NETMASK=225.255.255.0

Restart the Network Manager Service.

[root@localhost ~]# systemctl restart NetworkManager

Step 3 Configure the configuration file.

cp /usr/share/doc/dhcp*/dhcpd.conf.sample /etc/dhcp/dhcpd.conf

[root@localhost ~]# vi /etc/dhcp/dhcpd.conf

# Set DNS name and DNS server’s IP address or hostname

# Declare DHCP Server

authoritative;

# The default DHCP lease time

default-lease-time 600;

# Set the maximum lease time

max-lease-time 7200;

# Define the subnet of the DHCP server interface (Network address and subnet mask)

subnet 172.168.10.0 netmask 255.255.255.0{

# Define the range of IP addresses

range 172.168.10.100 172.168.10.200;

#Define the Domain Name Servers(DNS)

option domain-name-servers 8.8.8.8,8.8.4.4;

# Define the gateway

option routers 172.168.10.1;

# Define the broadcast address

option broadcast-address 172.168.10.255;

}

# Fixed Host IP Address assigning

host myclient2 {

# Define the MAC address

hardware ethernet 08:00:27:5a:54:1d;

# Define Fixed IP address

fixed-address 172.168.10.200;

}

Step 4 Enable and activate the dhcp seervice

[root@localhost ~]# systemctl start/enable dhcpd

[root@localhost ~]# systemctl status dhcpd

● dhcpd.service – DHCPv4 Server Daemon

Loaded: loaded (/usr/lib/systemd/system/dhcpd.service; enabled; vendor preset: disabled)

Active: active (running) since Wed 2020-07-01 23:36:18 BST; 1h 9min ago

Step 5 Adjustt the firewall

[root@localhost ~]# firewall-cmd –permanent –add-service=dhcp

success

Or

[root@localhost ~]# firewall-cmd –permanent –add-port=67/tcp

success

[root@localhost ~]# firewall-cmd –reload

success

Step 6 Testing the DHCP

Now, I have two clients on my network. I let one of them get an IP address assigned by the DHCP Server, and the other one specifically assigned to a MAC address (with 08:00:27:5a:54:1d) which is not going to assign to a DHCP Server on any other machines.

Client 1

Client 2

MAC Address is 08:00:27:5a:54:1d

Port forwarding on CISCO and Huawei Routers

The main objective of this article is to find out a simple port forwarding technique that uses two rather popular routers. As shown in this picture, let see how we can access a local network from a remote one, and then access that IP via port forwarding. For this configuration, we will be using CISCO and HUAWEI routers.

To forward a port on a CISCO system, we’ll have to access the firewall and its subcategory “Single Port Forwarding” to assign a necessary port to forward. Here I have assigned any traffic that’s coming outside of WAN to be forwarded to port 1815 and the IP address 192.168.1.104 in LAN. I have labelled it as IPCAM under the Application column.

Complete Video stream can not be seen for a local site if you haven’t enabled Remote management, HTTP and UPnP. Even, UPnP is giving us a better infrastructure to communication, by enabling it gives us an additional risk through outside hacking. It is not always wise to enabling UPnP without a reasonable explanation.

On this router, I have forwarded a port by assigning a Virtual Server (IPCAM). As in the previous router, WAN port 1815 – I have direct it into LAN port 1815 with IP 192.168.8.101.

The Universal Plug and Play (UPnP) service allow intelligent connection between two UPnP devices through port forwarding. UPnP devices can obtain IP addresses automatically and access the Internet dynamically. Although, UPnP does all of these magical things- enabling it is a great security risk, and should only be activated if absolutely necessary.

Finally, go to the Local Network, and issue the following (http://wan_ip:1815) to access the IP cam in Remote Network. Now you can access the IPCam by entering its username and password.

Rsync Backup Script for Synology.

It is necessary to make the following adjustments to Synology (Personal Cloud) before backing up any data. If not, the script will fail.

First of all, install the “sshpass” package onto the client machine (On Local or Laptop PC). It provides the password directly to the script without having to enter it manually (create a text file with password).

[root@localhost ~]# dnf install sshpass -y

Enable the Rsync service to render your DiskStation as a backup destination for another Synology server or Rsync-compatible service via the following services. Be sure to enable Rsync and the Rsync account.

(control Panel → File services → rsync-→ enable rsync service and enable rynsc)

NB:- If needed, we can change port 22 to different port for secure synchronization by assigning a different port value. (If the port is 31947,the following command is required for synchronization)

sshpass -f /root/file1 rsync -av -e ‘ssh -p 31947’ –update –timeout=60 /home/admin/Documents/ admin@192.168.1.105:/volume1/admin/Laptop/Documents/ 2> /dev/null # (ssh port 31947)

Further Edit rsync Account and enter admin username and password.

After that, access “Terminal & SNMP” option and enable the ssh service. If needed, you can change port 22 to a different value.

Further Control Panel – > Terminal & SNMP -→Enable ssh services

Run this script as a cron job to automatically backup the necessary files and folders, as shown below.

  • Cron job

[root@localhost ~]# vi /etc/crontab

HELL=/bin/bash

PATH=/sbin:/bin:/usr/sbin:/usr/bin

MAILTO=root

# For details see man 4 crontabs

# Example of job definition:

# .—————- minute (0 – 59)

# | .————- hour (0 – 23)

# | | .———- day of month (1 – 31)

# | | | .——- month (1 – 12) OR jan,feb,mar,apr …

# | | | | .—- day of week (0 – 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat

# | | | | |

# * * * * * user-name command to be executed

00 23 * * * root /root/mybackup.sh >> /var/log/backup.log

  • Script

[root@localhost ~]# vi mybackup.sh

#!/bin/bash

#Backup Sources

ORIGIN_PATH1=/home/admin/Documents/

ORIGIN_PATH2=/home/admin/Downloads/

#Backup destination listed below

BACKUP_PATH1=/volume1/NetBackup/

BACKUP_PATH2=/volume1/NetBackup/

#File path for password file

PASS_PATH=/root/mypassword.txt

#This is used to detect the IP address automatically.

IP=`arp -an | grep 00:11:32:9d:a0:bc | awk ‘{print $2}’ | sed ‘s/[()]//g’`

#Backup to the right destination

sshpass -f $PASS_PATH rsync -av -e ‘ssh -p 22’ –update –timeout=150 $ORIGIN_PATH1 admin@$IP:$BACKUP_PATH1 2> /dev/null

sleep 15

sshpass -f $PASS_PATH rsync -av -e ‘ssh -p 22’ –update –timeout=60 $ORIGIN_PATH2 admin@$IP:$BACKUP_PATH2 2> /dev/null

The rclone & sync commands with Google Drive.

There are so many ways to connect to google drive and transfer files in between google-drive and devices. However, I notice that this is one of the easier and efficient ways of transferring files between google drive and Linux systems.

First, we have to install rsync and rclone packages as mentioned below.

[root@localhost ~]# dnf -y install rsync rclone

Then, let’s get starting the configuration. It is a lengthy process, but we set up most of the defaults as our settings. I have considered all the default values to make this process simple.

[root@localhost ~]# rclone config

No remotes found – make a new one

n) New remote

s) Set configuration password

q) Quit config

n/s/q> n

name> Google-drive

Google Application Client Id

Setting your own is recommended.

See https://rclone.org/drive/#making-your-own-client-id for how to create your own.

If you leave this blank, it will use an internal key which is low performance.

Enter a string value. Press Enter for the default (“”).

client_id>

Google Application Client Secret

Setting your own is recommended.

Enter a string value. Press Enter for the default (“”).

client_secret>

Scope that rclone should use when requesting access from drive.

Enter a string value. Press Enter for the default (“”).

Choose a number from below, or type in your own value

1 / Full access all files, excluding Application Data Folder.

\ “drive”

2 / Read-only access to file metadata and file contents.

\ “drive.readonly”

/ Access to files created by rclone only.

3 | These are visible in the drive website.

| File authorization is revoked when the user deauthorizes the app.

\ “drive.file”

/ Allows read and write access to the Application Data folder.

4 | This is not visible in the drive website.

\ “drive.appfolder”

/ Allows read-only access to file metadata but

5 | does not allow any access to read or download file content.

\ “drive.metadata.readonly”

scope> 1

ID of the root folder

Leave blank normally.

Fill in to access “Computers” folders (see docs), or for rclone to use

a non root folder as its starting point.

Note that if this is blank, the first time rclone runs it will fill it

in with the ID of the root folder.

Enter a string value. Press Enter for the default (“”).

root_folder_id>

Service Account Credentials JSON file path

Leave blank normally.

Needed only if you want use SA instead of interactive login.

Enter a string value. Press Enter for the default (“”).

service_account_file>

Edit advanced config? (y/n)

y) Yes

n) No (default)

y/n> n

Remote config

Use auto config?

* Say Y if not sure

* Say N if you are working on a remote or headless machine

y) Yes (default)

n) No

y/n> y

If your browser doesn’t open automatically go to the following link: http://127.0.0.1:53682/auth?state=OS6a7OBzHlRWd4y9fUR-Rg

Log in and authorize rclone for access

Waiting for code…

Got code

Configure this as a team drive?

y) Yes

n) No (default)

y/n> n

——————–

[Google-drive]

type = drive

scope = drive

token = {“access_token”:”ya29.a0AfH6SMCwSktnReLM5G8l_AOcMs-_bCa7LQ0pl_TkjLhnhUdsQlcNMi7pSJm1btBLv0xdpVDICIPsK0qK75SDEO5wDsundTfQPjloYRTeTtiM31uuA9yStoUjz1x2uYtNYBNbEf5HAFXO8delbFNWAO0PlZNNjX9WQJs”,”token_type”:”Bearer”,”refresh_token”:”1//031lYS2TuFrqSCgYIARAAGAMSNwF-L9IrlZxFreAqv5UWhV0bYLinqkfQWfECl_4gowYPVoHPon32JePwJ016YG8LmFUAiQsqd0c”,”expiry”:”2020-06-26T01:05:37.397442258+01:00″}

——————–

y) Yes this is OK (default)

e) Edit this remote

d) Delete this remote

y/e/d> y

Current remotes:

Name Type

==== ====

Google-drive drive

e) Edit existing remote

n) New remote

d) Delete remote

r) Rename remote

c) Copy remote

s) Set configuration password

q) Quit config

e/n/d/r/c/s/q> q

  • Check the configuration

[root@localhost ~]# rclone listremotes

Google-drive:

Apart from this, it also has a man page you can refer it too for additional references.

  • Identify the version

[root@localhost ~]# rclone –version

rclone v1.51.0

– os/arch: linux/amd64

– go version: go1.12.12

  • List the directories in Drive.

[root@localhost ~]# rclone lsd Google-drive:

-1 2017-05-21 01:10:51 -1 Archives

-1 2020-06-17 20:32:08 -1 Documents

-1 2017-04-14 23:46:43 -1 videos

-1 2020-06-24 21:54:00 -1 NetBackup

-1 2016-02-24 13:56:03 -1 tmp

-1 2016-01-04 16:48:40 -1 audio

-1 2016-02-05 21:41:37 -1 Downloads

-1 2016-01-25 21:01:56 -1 books

-1 2016-01-05 20:28:17 -1 pictures

  • Sync the folder to google-drive

[root@localhost ~]# rclone sync –progress /home/alwis/Documents/ Google-drive:/Documents

Transferred: 140.187M / 1.219 GBytes, 11%, 2.056 MBytes/s, ETA 8m59s

Checks: 388 / 388, 100%

Transferred: 2 / 4, 50%

Elapsed time: 1m8.1s

Transferring:

* Documents/boot.iso: 13% /624M, 940.470k/s, 9m48s

* Documents/backups/boot.iso: 8% /624M, 841.129k/s, 11m31s

  • Sync the files from Google-drive

[root@localhost ~]# rclone sync –progress Google-drive:audio /root/myaudio/

Transferred: 1.384G / 2.520 GBytes, 55%, 3.319 MBytes/s, ETA 5m50s

Checks: 16 / 16, 100%

Transferred: 279 / 401, 70%

Elapsed time: 7m7.1s

Transferring:

* AJ/Disobedience.mp3: 75% /3.957M, 766.986k/s, 1s

* AJ/Day of the Dead MS.mp3: 35% /33.369M, 630.026k/s, 34s

  • List the sync folders in Google-drive

[root@localhost ~]# rclone lsd Google-drive:Documents

-1 2020-06-25 23:48:56 -1 AAA

-1 2020-06-25 23:45:49 -1 AES Crypt

-1 2020-06-25 23:45:53 -1 Books

-1 2020-06-25 23:46:26 -1 Documents

-1 2020-06-25 23:46:23 -1 Google-drive

-1 2020-06-25 23:45:52 -1 K3B

-1 2020-06-25 23:45:50 -1 Terminator

-1 2020-06-25 23:45:54 -1 VLC Player

-1 2020-06-25 23:46:07 -1 VirtualBox

  • Mount the Google-drive onto /mnt

[root@localhost ~]# rclone mount Google-drive: /mnt

[root@localhost ~]# ls /mnt/

audio backups books ‘Computer Science’ Documents ‘My CV’ NetBackup pictures Tmp

K3b on CentOS 8

K3b provides a comfortable user interface to perform most CD/DVD burning tasks. While an experienced user can influence every step of the burning process – a beginner may be more comfortable with automatic settings alongside the reasonable k3b defaults which allow for a quick start.


K3b is created to be a feature-rich and easy to handle the application for CD burning.

Let’s install the K3b. First, we have to install the EPEL repositories mentioned below.

Then install k3b package.

After that, you are able to access k3b by following given path: (Applications → Sounds & Videos → K3b)

Please click on “K3b” option to access it’s option menus. Then select your creation settings as necessary, CD create, DVD, burn iso, ..etc.

K3b does not have a man page but it still has help options as mentioned below.