[SSH] use SSH keys for authentication to server with saved user and password
Use below command:
% ssh-copy-id -i ~/.ssh/mykey <user>@<host>
Or
% ssh-copy-id -i ~/.ssh/id_rsa.pub <host>
Use below command:
% ssh-copy-id -i ~/.ssh/mykey <user>@<host>
Or
% ssh-copy-id -i ~/.ssh/id_rsa.pub <host>
The syntax is
git clone -b 'tag' --single-branch --depth 1 https://github.com/git/git.git
For example
git clone -b master --single-branch https://github.com/greenbone/openvas-smb.git
git clone -b gvmd-20.08 --single-branch https://github.com/greenbone/gvmd.git
1. List items are ordered, changeable, and allow duplicate values.
mylist = ["apple", "banana", "cherry"]
2. Tuple items are ordered, unchangeable, and allow duplicate values.
mytuple = ("apple", "banana", "cherry")
3. Set items are unordered, unchangeable, and do not allow duplicate values.
myset = {"apple", "banana", "cherry"}
4. A dictionary is a collection which is ordered*, changeable and does not allow duplicates.
thisdict = {
"brand": "Ford",
"model": "Mustang",
"year": 1964
}
Noted: *As of Python version 3.7, dictionaries are ordered. In Python 3.6 and earlier, dictionaries are unordered.
1 Edit .bashrc
bermmerb@Berm-PC:/mnt/c/Users/berm$ sudo vim ~/.bashrc
2 Put the scripts in the end of file.
LS_COLORS="ow=01;36;40" && export LS_COLORS
LS_COMMON="-hG"
LS_COMMON="$LS_COMMON --color=auto"
LS_COMMON="$LS_COMMON -I NTUSER.DAT* -I ntuser.dat*"
test -n "$LS_COMMON" &&
alias ls="command ls $LS_COMMON"
alias ll="ls -l"
alias la="ls -a"
alias lal="ll -a"
3 Restart terminal and done.
In administrator command prompt
lodctr /R
Sometimes when install or update Openvas. There is an error message on web browser indicate that “The request contained an unknown or invalid Host header”
The request contained an unknown or invalid Host header. If you are trying to access GSA via its hostname or a proxy, make sure GSA is set up to allow it.
Here is how to solve this problem.
1. Edit /etc/default/openvas-gsa in the ALLOW_HEADER_HOST
root@host# vim /etc/default/openvas-gsa
2. Uncomment the section and add your host.
# To allow <host> as hostname/address part of a Host header:
#
ALLOW_HEADER_HOST=PUT YOUR HOST NAME HERE
3. restarting gsad service with /etc/init.d/openvas-gsa restart
root@host# /etc/init.d/openvas-gsa restart
4. Done. Verify the result in web browser.
1. Install
sudo apt-get install smartmontools
2. Verify HDD support S.M.A.R.T
sudo /sbin/sudo smartctl -i /dev/sde
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.3.10-1-pve] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Family: Western Digital Green
Device Model: WDC WD20EZRX-00D8PB0
Serial Number: WD-WMC4M0DF2257
LU WWN Device Id: 5 0014ee 6afbfdb12
Firmware Version: 80.00A80
User Capacity: 2,000,397,852,160 bytes [2.00 TB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: 5400 rpm
Device is: In smartctl database [for details use: -P show]
ATA Version is: ACS-2 (minor revision not indicated)
SATA Version is: SATA 3.0, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is: Tue Mar 24 17:10:57 2020 +07
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
3. Test
sudo /sbin/smartctl -t <short|long|conveyance|select> -C /dev/sde
sudo /sbin/smartctl -t long /dev/sde
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.3.10-1-pve] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===
Sending command: "Execute SMART Extended self-test routine immediately in off-line mode".
Drive command "Execute SMART Extended self-test routine immediately in off-line mode" successful.
Testing has begun.
Please wait 266 minutes for test to complete.
Test will complete after Tue Mar 24 21:27:39 2020 +07
Use smartctl -X to abort test.
4. Verify result
sudo /sbin/smartctl -a /dev/sde
SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Short offline Completed without error 00% 7757 -
root@user-pve:/home/user# /usr/sbin/zpool status -v
pool: user-storage
state: DEGRADED
status: One or more devices has experienced an unrecoverable error. An
attempt was made to correct the error. Applications are unaffected.
action: Determine if the device needs to be replaced, and clear the errors
using 'zpool clear' or replace the device with 'zpool replace'.
see: http://zfsonlinux.org/msg/ZFS-8000-9P
scan: scrub repaired 280K in 0 days 04:33:34 with 0 errors on Sun Jan 12 04:57:36 2020
config:
NAME STATE READ WRITE CKSUM
user-storage DEGRADED 0 0 0
raidz1-0 DEGRADED 0 0 0
sda ONLINE 0 0 0
sdb ONLINE 0 0 0
sdc ONLINE 0 0 0
sdd ONLINE 0 0 0
sde DEGRADED 0 0 74 too many errors
errors: No known data errors
root@user-pve:/home/user#
root@user-pve:/home/user# /usr/sbin/zpool clear user-storage sde
root@user-pve:/home/user# /usr/sbin/zpool status -v
pool: user-storage
state: ONLINE
scan: scrub in progress since Sun Jan 19 19:17:39 2020
10.7G scanned at 1.53G/s, 1.32M issued at 193K/s, 877G total
0B repaired, 0.00% done, no estimated completion time
config:
NAME STATE READ WRITE CKSUM
user-storage ONLINE 0 0 0
raidz1-0 ONLINE 0 0 0
sda ONLINE 0 0 0
sdb ONLINE 0 0 0
sdc ONLINE 0 0 0
sdd ONLINE 0 0 0
sde ONLINE 0 0 0
errors: No known data errors
root@user-pve:/home/user# apt update
Had to comment away the following in the config file:
user@ubuntu:~$ sudo vim /etc/samba/smb.conf
Comment out “map to guest = bad user” line.
# This option controls how unsuccessful authentication attempts are mapped
# to anonymous connections
# map to guest = bad user
Restart samba service
user@ubuntu:~$ sudo /etc/init.d/smbd restart
Done.
After kernel upgrade, ZFS couldn’t start, but some process create some file in the mount point. So after that ZFS can’t start the process ever again. Here’s how to fix.
1. disable service zfs.target and restart.
user@ubuntu:~$ sudo systemctl disable zfs.target
2. after reboot delete or move data in mount point to another location.
3. enable service zfs.target and restart.
user@ubuntu:~$ sudo systemctl enable zfs.target
4. after reboot move data back.