Kali/Post Install: Difference between revisions
From charlesreid1
(Created page with "Post-install procedure for Kali: ==Fix SSH Keys== Fix SSH keys. First, install OpenSSH server: <pre> $ apt-get install openssh-server </pre> Update the SSH service to be a...") |
|||
| (12 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
Post-install procedure for Kali: | Post-install procedure for Kali: | ||
==Update Aptitude== | |||
Make sure everything is up to date before you begin: | |||
<pre> | |||
$ sudo apt-get -y update | |||
$ sudo apt-get -y dist-upgrade | |||
</pre> | |||
just makin sure: | |||
<pre> | |||
$ sudo apt-get install -y vim screen tmux | |||
</pre> | |||
and in case you wanna make a spreadsheet: | |||
<pre> | |||
$ sudo apt-get install libreoffice | |||
</pre> | |||
==Fix SSH Keys== | ==Fix SSH Keys== | ||
| Line 28: | Line 49: | ||
<pre> | <pre> | ||
$ dpkg-reconfigure openssh-server | $ dpkg-reconfigure openssh-server | ||
</pre> | |||
If you want to enable root login at this point, do so: | |||
<pre> | |||
$ vim /etc/ssh/sshd_config | |||
</pre> | |||
add the line | |||
<pre> | |||
PermitRootLogin yes | |||
</pre> | |||
Set ssh to start running on all runlevels: | |||
<pre> | |||
update-rc.d -f ssh enable 2 3 4 5 | |||
</pre> | |||
==Add Non-Root User== | |||
===List all users on system=== | |||
Let's start by looking at what users are on the systeHOLY TOLEDO THAT IS A LOOOOOOT OF USERS | |||
<pre> | |||
root@mars:~# cut -d: -f1 /etc/passwd | |||
root | |||
daemon | |||
bin | |||
sys | |||
sync | |||
games | |||
man | |||
lp | |||
mail | |||
news | |||
uucp | |||
proxy | |||
www-data | |||
backup | |||
list | |||
irc | |||
gnats | |||
nobody | |||
libuuid | |||
mysql | |||
messagebus | |||
colord | |||
usbmux | |||
miredo | |||
ntp | |||
Debian-exim | |||
arpwatch | |||
avahi | |||
beef-xss | |||
dradis | |||
pulse | |||
speech-dispatcher | |||
haldaemon | |||
sshd | |||
snmp | |||
iodine | |||
postgres | |||
redsocks | |||
stunnel4 | |||
statd | |||
sslh | |||
Debian-gdm | |||
rtkit | |||
saned | |||
dnsmasq | |||
</pre> | |||
THAT IS A LOT OF USERS | |||
===List all users logged in=== | |||
But only one of those many, many users is logged in: | |||
<pre> | |||
root@mars:~# w | |||
23:32:24 up 13:26, 2 users, load average: 0.00, 0.01, 0.05 | |||
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT | |||
root pts/0 10.0.0.120 23:18 0.00s 0.16s 0.00s w | |||
</pre> | |||
===Add new user=== | |||
Now we can add our new user: | |||
<pre> | |||
root@mars:~# useradd -m charles | |||
</pre> | |||
the m flag creates a home user. Check out our user's user id and group id: | |||
<pre> | |||
root@mars:~# id charles | |||
uid=1000(charles) gid=1001(charles) groups=1001(charles) | |||
</pre> | |||
Change user password: | |||
<pre> | |||
root@mars:~# passwd charles | |||
</pre> | |||
Add the user to the sudoers group: | |||
<pre> | |||
root@mars:~# usermod -a -G sudo charles | |||
</pre> | |||
Specify shell: | |||
<pre> | |||
root@mars:~# chsh -s /bin/bash charles | |||
</pre> | </pre> | ||
| Line 33: | Line 173: | ||
See [[Kali/Fixes]] for fixing everything else | See [[Kali/Fixes]] for fixing everything else | ||
{{KaliFlag}} | |||
Latest revision as of 10:19, 19 August 2017
Post-install procedure for Kali:
Update Aptitude
Make sure everything is up to date before you begin:
$ sudo apt-get -y update $ sudo apt-get -y dist-upgrade
just makin sure:
$ sudo apt-get install -y vim screen tmux
and in case you wanna make a spreadsheet:
$ sudo apt-get install libreoffice
Fix SSH Keys
Fix SSH keys. First, install OpenSSH server:
$ apt-get install openssh-server
Update the SSH service to be at the default runlevel (i.e., to run on boot):
$ update-rc.d -f ssh remove $ update-rc.d -f ssh defaults
Move the old SSH keys somewhere else:
$ cd /etc/ssh/ $ mkdir insecure_original_default_kali_keys $ mv ssh_host_* insecure_original_default_kali_keys/
And finally, make new SSH keys for this machine.
$ dpkg-reconfigure openssh-server
If you want to enable root login at this point, do so:
$ vim /etc/ssh/sshd_config
add the line
PermitRootLogin yes
Set ssh to start running on all runlevels:
update-rc.d -f ssh enable 2 3 4 5
Add Non-Root User
List all users on system
Let's start by looking at what users are on the systeHOLY TOLEDO THAT IS A LOOOOOOT OF USERS
root@mars:~# cut -d: -f1 /etc/passwd root daemon bin sys sync games man lp mail news uucp proxy www-data backup list irc gnats nobody libuuid mysql messagebus colord usbmux miredo ntp Debian-exim arpwatch avahi beef-xss dradis pulse speech-dispatcher haldaemon sshd snmp iodine postgres redsocks stunnel4 statd sslh Debian-gdm rtkit saned dnsmasq
THAT IS A LOT OF USERS
List all users logged in
But only one of those many, many users is logged in:
root@mars:~# w 23:32:24 up 13:26, 2 users, load average: 0.00, 0.01, 0.05 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT root pts/0 10.0.0.120 23:18 0.00s 0.16s 0.00s w
Add new user
Now we can add our new user:
root@mars:~# useradd -m charles
the m flag creates a home user. Check out our user's user id and group id:
root@mars:~# id charles uid=1000(charles) gid=1001(charles) groups=1001(charles)
Change user password:
root@mars:~# passwd charles
Add the user to the sudoers group:
root@mars:~# usermod -a -G sudo charles
Specify shell:
root@mars:~# chsh -s /bin/bash charles
Fix Everything Else
See Kali/Fixes for fixing everything else