Журнал лабораторных работ

Содержание

Журнал

Четверг (07/12/12)

/dev/pts/0
18:41:09
#grep root /etc/passwd /etc/shadow-
/etc/passwd:root:x:0:0:root:/root:/bin/bash
/etc/shadow-:root:$6$4PSCFZEO$y.5fPXEbAokZKAweL1gniUpZcdbpSUQNJIDJ/uFi5Vmt12Fyo2LQkg9cFxweI3BkLpBtlR.0r.D.RbR7R5BWh.:15502:0:99999:7:::
18:42:36
#man shadow
18:45:51
#la -l /var/log/btmp
l3script: la: command not found
18:48:23
#ls -l /var/log/btmp
-rw-rw---- 1 root utmp 1152 Jun 11 20:46 /var/log/btmp
18:48:28
#less /var/log/btmp
18:48:45
#strings /var/log/btmp
tty1
root
hvc0
root
hvc0
user
18:49:00
#lastb
user     hvc0                          Mon Jun 11 20:46 - 20:46  (00:00)
root     hvc0                          Mon Jun 11 12:37 - 12:37  (00:00)
root     tty1                          Mon Jun 11 12:27 - 12:27  (00:00)
btmp begins Mon Jun 11 12:27:02 2012
18:49:16
#strings /var/log/wtmp
2.6.32-5-xen-686
reboot
2.6.32-5-xen-686
runlevel
2.6.32-5-xen-686
2.6.32-5-xen-686
2.6.32-5-xen-686
2.6.32-5-xen-686
2.6.32-5-xen-686
2.6.32-5-xen-686
...
hvc0
LOGIN
tty2
LOGIN
tty1
LOGIN
pts/0
ts/0root
195.238.93.36
OGG
18:50:08
#last
last     lastb    lastlog
18:50:08
#last
last     lastb    lastlog
18:50:08
#last
last     lastb    lastlog
18:50:08
#last
last     lastb    lastlog
18:50:08
#lastlog
Username         Port     From             Latest
root             pts/0    195.238.93.36    Thu Jul 12 16:09:55 +0000 2012
daemon                                     **Never logged in**
bin                                        **Never logged in**
sys                                        **Never logged in**
sync                                       **Never logged in**
games                                      **Never logged in**
man                                        **Never logged in**
lp                                         **Never logged in**
mail                                       **Never logged in**
...
proxy                                      **Never logged in**
www-data                                   **Never logged in**
backup                                     **Never logged in**
list                                       **Never logged in**
irc                                        **Never logged in**
gnats                                      **Never logged in**
nobody                                     **Never logged in**
libuuid                                    **Never logged in**
user             hvc0                      Mon Jun 11 20:46:29 +0000 2012
sshd                                       **Never logged in**
18:50:21
#w
 16:50:40 up  1:37,  1 user,  load average: 0.04, 0.01, 0.00
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT
root     pts/0    195.238.93.36    16:09    0.00s  0.41s  0.04s script -f -c l3script -q /root/.lilalo//1759523166122444767-1342109400.script
18:50:40
#last
root     pts/0        195.238.93.36    Thu Jul 12 16:09   still logged in
reboot   system boot  2.6.32-5-xen-686 Thu Jul 12 15:14 - 16:50  (01:36)
root     pts/1        195.238.93.36    Thu Jul  5 16:08 - 11:09 (4+19:00)
root     pts/0        195.238.93.36    Thu Jul  5 16:08 - 12:57 (4+20:49)
root     pts/1        195.238.93.36    Tue Jul  3 16:19 - 12:09 (1+19:50)
root     pts/0        195.238.93.36    Tue Jul  3 16:15 - 12:15 (1+20:00)
reboot   system boot  2.6.32-5-xen-686 Tue Jul  3 14:16 - 15:38 (7+01:22)
root     pts/1        195.238.93.36    Tue Jun 26 16:53 - 17:43  (00:49)
root     pts/0        195.238.93.36    Tue Jun 26 16:53 - 17:43  (00:50)
root     pts/2        195.238.93.36    Tue Jun 26 16:37 - 16:48  (00:11)
root     pts/0        195.238.93.36    Tue Jun 26 16:04 - 16:48  (00:44)
reboot   system boot  2.6.32-5-xen-686 Tue Jun 26 11:52 - 15:38 (14+03:46)
wtmp begins Tue Jun 26 11:52:08 2012
18:50:44
#cat group
root:x:0:
daemon:x:1:
bin:x:2:
sys:x:3:
adm:x:4:
tty:x:5:
disk:x:6:
lp:x:7:
mail:x:8:
news:x:9:
...
sasl:x:45:
plugdev:x:46:
staff:x:50:
games:x:60:
users:x:100:
nogroup:x:65534:
libuuid:x:101:
crontab:x:102:
user:x:1000:
ssh:x:103:
18:56:29
#ls -l sudoers
-r--r----- 1 root root 491 Jun 11 17:52 sudoers
18:58:15
#user
useradd  userdel  usermod  users
18:58:15
#user
useradd  userdel  usermod  users
18:58:15
#user
useradd  userdel  usermod  users
18:58:15
#user
useradd  userdel  usermod  users
18:58:15
#user
useradd  userdel  usermod  users
18:58:15
#user
useradd  userdel  usermod  users
18:58:15
#user
useradd  userdel  usermod  users
18:58:15
#usermod -d user
Usage: usermod [options] LOGIN
Options:
  -c, --comment COMMENT         new value of the GECOS field
  -d, --home HOME_DIR           new home directory for the user account
  -e, --expiredate EXPIRE_DATE  set account expiration date to EXPIRE_DATE
  -f, --inactive INACTIVE       set password inactive after expiration
                                to INACTIVE
  -g, --gid GROUP               force use GROUP as new primary group
  -G, --groups GROUPS           new list of supplementary GROUPS
  -a, --append                  append the user to the supplemental GROUPS
...
  -l, --login NEW_LOGIN         new value of the login name
  -L, --lock                    lock the user account
  -m, --move-home               move contents of the home directory to the
                                new location (use only with -d)
  -o, --non-unique              allow using duplicate (non-unique) UID
  -p, --password PASSWORD       use encrypted password for the new password
  -s, --shell SHELL             new login shell for the user account
  -u, --uid UID                 new UID for the user account
  -U, --unlock                  unlock the user account
  -Z, --selinux-user            new SELinux user mapping for the user account
18:59:52
#usermod -L user

19:00:09