linux常用命令

1./etc/passwd,/etc/shadow,/etc/group
/etc/passwd username:passwd:uid:gid:describe:directory:shell
/etc/group groupname:passwd:groupid:groupuser
/etc/shadow login:passwd:last:min:max:warn:inactive:lost
2. userdel: user newname is currently logged in
w
pkill -kill -t pts/1
userdel -f 
3.file exist,but user is not exist

find / --nouser -exec rm - rf {} \; 
4.create a user as root  
useradd xxx
passwd xxx    
modify uid & gid from /etc/passwd of xxx     
5.lock user    
a.modify password the user in /etc/shadow with "*"      

b.usermod -L username or usermod -U username
c.chsh username -s /sbin/nologin
d.touch /etc/nologin
6.view users
cat /etc/passwd |cut -f 1 -d :
7.touch /etc/login.defs
    PASS_MAX_DAYS 99999
    PASS_MIN_DAYS 0
    PASS_MIN_LEN 5
    PASS_WARN_AGE 7
8.change
  /etc/shadow
9.groupadd -g gid groupname
useradd oracle -g oinstall -G dba
10.chmod ugo+r file1.txt
chmod a+r file1.txt
chmod ug+w,o-w file1.txt file2.txt
chmod u+x user
chmod -R a+r *
chmod -R lamport:users *
11.kill -9 pid
kill -SIGKILL XXX
12.crontab -e
*  *  *  *  *  command
min hour day month week
13.ln -s sourcefile directoryfile
14./etc/xinetd.d/rsync
# default: on
# description: The rsync server is a good addition to an ftp server, as it \
#    allows crc checksumming etc.
service rsync
{
    disable    = no
    flags        = IPv6
    socket_type     = stream
    wait            = no
    user            = root
    server          = /usr/sbin/in.telnetd
    server_args     = --daemon
    log_on_failure  += USERID
}

posted on 2013-06-15 17:53  awk  阅读(195)  评论(0)    收藏  举报

导航