User Management in Linux
user information stored / etc / passwd, the average user has permission to read
real user: change the password, you can log
pseudo-user: the application at runtime to run some privileges, and use the program name to represents the program, and the presence of / etc / passwd file, the user can not log in directly to the pseudo
PenTest (user name): x (password): 1000 (UID): 1000 (GID): pentest ,,, ( description): / home / pentest (home directory): / bin / bash (default parser)
would last change to / sbin / nologin, the user can not log
user passwords are stored in / etc / shadow, under normal circumstances, ordinary users do not read permissions
pentest (username): $ 6 $ Fq0je7pf $ kDasczSHFj9k1XO2xArIymt8IzDK97jbXjD8XvFvVMohp2RBHMKBuUbHSlR6NBlhh1tFrxe0tujp.fmgW9kKB ( password) /: 18150 (last modified time password): 0 (effectively alter the code shortest time): 99999 (maximum time): 7 :::
last three bit password policy is
to add a user:
useradd [option] username
useradd -u 5000 -g demogroup -G root -d / Home / Demo -s / bin / bash Demo
-u specifies the UID
-g specified group
-G also belong to the specified user other groups
-d Specifies the home directory (home directory, home directory, the default directory)
-s specifies the parser
-o -u general use and at the same time, create the same user ID and other user
Plus password:
the Passwd username
delete users:
userdel username
modify the user:
the usermod -l / -d / -g / -s username
-l modify the user name: the usermod -l the Test Number The
-d modify the home directory: usermod -d / Home / Ko the Test
-g modify your group: the usermod -g root the Test
-s modify the parser: usermod -s / bin / zsh test
disable users: usermod -L username
restore user: usermod -U user name
added by default users automatically add the user name the same group
Icq ICQ
root root
Pentest PenTest
Su switch user
user to view the currently logged: whoami id
view the current user belongs to which group: groups
View in Linux there is a current which groups:
groupadd group name
groupdel group name
pentest @ PVM: ~ $ grep Test / etc / Group
ADM: X:. 4: the syslog, PenTest
CDROM: X: 24: PenTest
the sudo: X: 27: PenTest
DIP: X: 30: PenTest
the plugdev: X: 46 is: PenTest
the lpadmin: X: 121: pentest
pentest: X: 1000:
SambaShare: X: 132: pentest
Test (group name): x (Group code): 1001 (GID) :( which the current user group)
to add the user to pentest test group:
the gpasswd -a test pentest
be removed from the test group pentest users:
the gpasswd test -d pentest
Change permissions command
Chmod [who] [+ | - | =] filename
Who: u-> owner g-> belongs to the group o-> others a-> everyone
+ Add permission - permission to cancel the assignment of certain rights =
r - r - r-- test.php
Chmod +320 test.php
rwxrwxrwx evil.php
Chmod -333 evil.php
Chmod 644 evil.php
Note: the way to change permissions recommend the use of digital
change your person or your group
Chown root / test will be owner of the test folder change to root
/ test group will test your asking price change folder chgrp ADMIN ADMIN
Chown root: root / tmp will be the owner of the / tmp folder belongs to root group to root
Chown -R root: root / tmp the owner of all files in / tmp to root to root belonging group
Xshell first ssh connection kali system
Xshell help us to connect the various services platform to facilitate the management server link is encrypted (ssh / vsftp)
Step 1: open ssh service is turned on detection of kali success /etc/init.d/ssh status or netstat -ntulp | grep 22
Step 2: Turn off the firewall (currently) /etc/init.d/iptables stop, and then need to find ssh configuration file
/ Etc / ssh / sshd_config about 27 rows "#PermiaRootLogin prohibit-password" modify
"PremitRootLogin yes" to save and exit
Step 3: service ssh restart /etc/init.d/ssh restart xshell connection using ordinary root account or accounts
update -re.d ssh enable set a power-enabled
Step 4: xshell: File - New - protocol selection ssh, enter kali host of ip, port 22 is the default and then click the link, then enter the root account password last
Note; ssh service can change the port, edit the configuration file, port 22-port 2222
Kali replacement update source
Vim /etc/apt/sources.list
Leafpad /etc/apt/sources.list
Apt-get update&&apt-get upgrade&&apt-get autoclean
Kali install software
Apt-get install open-vm-tools-desktop
Reboot
You can hold things up but can not pull directly to the desktop in the file - it can be in Desktop