-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathmisc_commands.txt
More file actions
72 lines (53 loc) · 2.73 KB
/
misc_commands.txt
File metadata and controls
72 lines (53 loc) · 2.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
List all users
cat /etc/passwd
List hosts aliases for ip address
cat /etc/hosts
List aliases, normally used when setting up email users
cat /etc/aliases
After setting new aliases or modifying above file, run 'newaliases'
List variable values (http_proxy is also provided here)
cat /etc/environment
List nameservers (DNS nameserver can be provided here or inside /etc/network/interfaces)
cat /etc/resolv.conf
List file sharing directories (It's activated using command 'mount -a')(Used for both nfs, cifs and automount)
(I think, normally used on client side)
cat /etc/fstab
List NFS sharing directories(for cifs/samba it's /etc/samba/smb.conf)(normally used on server side)
cat /etc/exports
List hostname
cat /etc/hostname
This file assigns persistent names to network interfaces
/etc/iftab
Info about distribution
cat /etc/lsb_release
cat /etc/os-release
Following file is time based job scheduler
/etc/crontab
List port numbers and services names
cat /etc/services
If you don't have systemd, use following to disable a service like 'ufw'
update-rc.d -f ufw remove (in vagrant vm it didn't work with ufw but worked with nfs-kernel-server)
After above command, I had issues enabling the service nfs-kernel-server for startup. I used following to fix it.
update-rc.d nfs-kernel-server default
It turns out that inside /etc/init.d/ some files are the services and some are pointing to /lib/init/upstart-job
Following is another way mentioned on internet but didn't work for my vagrant vms.
echo 'manual' | sudo tee /etc/init/mysql.override
Here's a summary:
If service is SysV(Also called init.d): Use 1) 'sudo service nfs-kernel-server stop', 2) 'sudo update-rc.d -f nfs-kernel-server remove' to disable and 'sudo update-rc.d nfs-kernel-server default' (ntp didn't work)
If service is Upstart: Use 'mv /etc/init/smbd.conf /etc/init/smbc.conf.disabled' and move it back to enable it.
If service is Systemd: Use systemctl enable/disable command.
When creating Self Signed keys for SSL using openssl, the option -nodes (not decrypted -> maybe) is used to encrpty the private key. If this optin is provided it will ask for passphrase. In case, openssl is used to create key and crt to be used in dovecot ssl, this argument should be used, otherwise you won't be able to connect to mail server.
For creating problems in network packets
tc qdisc add dev lo root netem loss random 40
tc qdisc del dev lo root
To see what packages are available
sudo apt search ntop
#Check which version of software is on the system
dpkg -l open-vm-tools
#To update
sudo apt-get install --only-upgrade open-vm-tools
(or) apt install --only-upgrade open-vm-tools
#Change home directory
usermod -d /dir/ user
# if you want ftp user to log into a specific directory, modify following file.
/etc/passwd