JavaScript is required to for searching.
跳过导航链接
退出打印视图
手册页第 1 部分:用户命令     Oracle Solaris 11.1 Information Library (简体中文)
为本文档评分
search filter icon
search icon

文档信息

前言

简介

User Commands

acctcom(1)

adb(1)

addbib(1)

admin(1)

alias(1)

allocate(1)

amt(1)

appcert(1)

apptrace(1)

apropos(1)

ar(1)

arch(1)

as(1)

asa(1)

at(1)

atq(1)

atrm(1)

audioconvert(1)

audioctl(1)

audioplay(1)

audiorecord(1)

audiotest(1)

auths(1)

auto_ef(1)

awk(1)

banner(1)

basename(1)

basename(1B)

batch(1)

bc(1)

bdiff(1)

bfs(1)

bg(1)

biff(1B)

break(1)

builtin(1)

cal(1)

calendar(1)

case(1)

cat(1)

cd(1)

cdc(1)

cdrw(1)

chdir(1)

checkeq(1)

checknr(1)

chgrp(1)

chkey(1)

chmod(1)

chown(1)

chown(1B)

ckdate(1)

ckgid(1)

ckint(1)

ckitem(1)

ckkeywd(1)

ckpath(1)

ckrange(1)

ckstr(1)

cksum(1)

cktime(1)

ckuid(1)

ckyorn(1)

clear(1)

cmp(1)

col(1)

comb(1)

comm(1)

command(1)

compress(1)

continue(1)

cp(1)

cpio(1)

cpp(1)

cputrack(1)

crle(1)

crontab(1)

csh(1)

csplit(1)

ct(1C)

ctags(1)

ctrun(1)

ctstat(1)

ctwatch(1)

cu(1C)

cut(1)

date(1)

dc(1)

deallocate(1)

decrypt(1)

delta(1)

deroff(1)

df(1B)

dhcpinfo(1)

diff(1)

diff3(1)

diffmk(1)

digest(1)

digestp(1)

dircmp(1)

dirname(1)

dirs(1)

dis(1)

disown(1)

dispgid(1)

dispuid(1)

dos2unix(1)

dpost(1)

du(1)

du(1B)

dump(1)

dumpcs(1)

dumpkeys(1)

echo(1)

echo(1B)

ed(1)

edit(1)

egrep(1)

eject(1)

elfdump(1)

elfedit(1)

elffile(1)

elfsign(1)

elfwrap(1)

encrypt(1)

enhance(1)

env(1)

eqn(1)

errange(1)

errdate(1)

errgid(1)

errint(1)

erritem(1)

error(1)

errpath(1)

errstr(1)

errtime(1)

erruid(1)

erryorn(1)

eval(1)

ex(1)

exec(1)

exit(1)

expand(1)

export(1)

exportfs(1B)

expr(1)

expr(1B)

exstr(1)

factor(1)

false(1)

fastboot(1B)

fasthalt(1B)

fc(1)

fg(1)

fgrep(1)

file(1)

file(1B)

filebench(1)

filep(1)

filesync(1)

filofaxp(1)

find(1)

finger(1)

fmt(1)

fmtmsg(1)

fold(1)

for(1)

foreach(1)

franklinp(1)

from(1B)

ftp(1)

function(1)

gcore(1)

gencat(1)

geniconvtbl(1)

genmsg(1)

get(1)

getconf(1)

getfacl(1)

getlabel(1)

getopt(1)

getoptcvt(1)

getopts(1)

gettext(1)

gettxt(1)

getzonepath(1)

glob(1)

goto(1)

gprof(1)

grep(1)

groups(1)

groups(1B)

grpck(1B)

hash(1)

hashcheck(1)

hashmake(1)

hashstat(1)

head(1)

helpdate(1)

helpgid(1)

helpint(1)

helpitem(1)

helppath(1)

helprange(1)

helpstr(1)

helptime(1)

helpuid(1)

helpyorn(1)

hist(1)

history(1)

hostid(1)

hostname(1)

i386(1)

i486(1)

iconv(1)

if(1)

indxbib(1)

install(1B)

ipcrm(1)

ipcs(1)

isainfo(1)

isalist(1)

jobs(1)

join(1)

jsh(1)

kbd(1)

kdestroy(1)

keylogin(1)

keylogout(1)

kill(1)

kinit(1)

klist(1)

kmdb(1)

kmfcfg(1)

kpasswd(1)

krb5-config(1)

ksh(1)

ksh88(1)

ksh93(1)

ktutil(1)

kvno(1)

lari(1)

last(1)

lastcomm(1)

ld(1)

ldapadd(1)

ldapdelete(1)

ldaplist(1)

ldapmodify(1)

ldapmodrdn(1)

ldapsearch(1)

ldd(1)

ld.so.1(1)

let(1)

lex(1)

lgrpinfo(1)

limit(1)

line(1)

list_devices(1)

listusers(1)

llc2_autoconfig(1)

llc2_config(1)

llc2_stats(1)

ln(1)

ln(1B)

loadkeys(1)

locale(1)

localedef(1)

logger(1)

logger(1B)

login(1)

logname(1)

logout(1)

look(1)

lookbib(1)

lorder(1)

ls(1)

ls(1B)

m4(1)

mac(1)

mach(1)

machid(1)

madv.so.1(1)

mail(1)

Mail(1B)

mail(1B)

mailcompat(1)

mailp(1)

mailq(1)

mailstats(1)

mailx(1)

make(1S)

makekey(1)

man(1)

mconnect(1)

mcs(1)

mdb(1)

mesg(1)

mkdir(1)

mkmsgs(1)

mkstr(1B)

mktemp(1)

moe(1)

more(1)

mp(1)

mpss.so.1(1)

msgcc(1)

msgcpp(1)

msgcvt(1)

msgfmt(1)

msggen(1)

msgget(1)

mt(1)

mv(1)

nawk(1)

nc(1)

ncab2clf(1)

ncakmod(1)

neqn(1)

netcat(1)

newform(1)

newgrp(1)

newsp(1)

newtask(1)

nice(1)

nl(1)

nm(1)

nohup(1)

notify(1)

nroff(1)

od(1)

on(1)

onintr(1)

optisa(1)

pack(1)

packagemanager(1)

page(1)

pagesize(1)

pargs(1)

passwd(1)

paste(1)

patch(1)

pathchk(1)

pax(1)

pcat(1)

pcred(1)

perl(1)

pfbash(1)

pfcsh(1)

pfexec(1)

pfiles(1)

pfksh(1)

pflags(1)

pfsh(1)

pftcsh(1)

pfzsh(1)

pg(1)

pgrep(1)

pkcs11_inspect(1)

pkg(1)

pkgdepend(1)

pkgdiff(1)

pkgfmt(1)

pkginfo(1)

pkglint(1)

pkgmerge(1)

pkgmk(1)

pkgmogrify(1)

pkgparam(1)

pkgproto(1)

pkgrecv(1)

pkgrepo(1)

pkgsend(1)

pkgsign(1)

pkgtrans(1)

pkill(1)

pklogin_finder(1)

pktool(1)

plabel(1)

pldd(1)

plgrp(1)

plimit(1)

pmadvise(1)

pmap(1)

pm-updatemanager(1)

popd(1)

ppgsz(1)

ppriv(1)

pr(1)

praliases(1)

prctl(1)

preap(1)

print(1)

printenv(1B)

printf(1)

priocntl(1)

proc(1)

prof(1)

profiles(1)

projects(1)

prs(1)

prt(1)

prun(1)

ps(1)

ps(1B)

psig(1)

pstack(1)

pstop(1)

ptime(1)

ptree(1)

pushd(1)

pvs(1)

pwait(1)

pwd(1)

pwdx(1)

radadrgen(1)

ranlib(1)

rcapstat(1)

rcp(1)

read(1)

readonly(1)

red(1)

refer(1)

regcmp(1)

rehash(1)

remote_shell(1)

remsh(1)

renice(1)

repeat(1)

reset(1B)

return(1)

rksh(1)

rksh88(1)

rlogin(1)

rm(1)

rmail(1)

rmdel(1)

rmdir(1)

rmformat(1)

rmmount(1)

rmumount(1)

roffbib(1)

roles(1)

rpcgen(1)

rpm2cpio(1)

rsh(1)

runat(1)

rup(1)

rup(1C)

ruptime(1)

rusage(1B)

rusers(1)

rwho(1)

sact(1)

sar(1)

sccs(1)

sccs-admin(1)

sccs-cdc(1)

sccs-comb(1)

sccs-delta(1)

sccsdiff(1)

sccs-get(1)

sccs-help(1)

sccshelp(1)

sccs-prs(1)

sccs-prt(1)

sccs-rmdel(1)

sccs-sact(1)

sccs-sccsdiff(1)

sccs-unget(1)

sccs-val(1)

scp(1)

script(1)

sdiff(1)

sed(1)

sed(1B)

select(1)

set(1)

setenv(1)

setfacl(1)

setlabel(1)

setpgrp(1)

settime(1)

sftp(1)

sh(1)

shcomp(1)

shell_builtins(1)

shift(1)

shutdown(1B)

size(1)

sleep(1)

soelim(1)

sort(1)

sortbib(1)

sotruss(1)

source(1)

sparc(1)

spell(1)

spellin(1)

split(1)

srchtxt(1)

ssh(1)

ssh-add(1)

ssh-agent(1)

ssh-http-proxy-connect(1)

ssh-keygen(1)

ssh-keyscan(1)

ssh-socks5-proxy-connect(1)

stop(1)

strchg(1)

strconf(1)

strings(1)

strip(1)

stty(1)

stty(1B)

sum(1)

sum(1B)

sun(1)

suspend(1)

svcprop(1)

svcs(1)

switch(1)

symorder(1)

sys-suspend(1)

sysV-make(1)

t300(1)

t300s(1)

t4014(1)

t450(1)

tabs(1)

tail(1)

talk(1)

tar(1)

tbl(1)

tcopy(1)

tee(1)

tek(1)

telnet(1)

test(1)

test(1B)

tftp(1)

time(1)

timemanp(1)

times(1)

timesysp(1)

timex(1)

tip(1)

touch(1)

touch(1B)

tplot(1)

tput(1)

tr(1)

tr(1B)

trap(1)

troff(1)

true(1)

truss(1)

tset(1B)

tsort(1)

tty(1)

type(1)

typeset(1)

ul(1)

ulimit(1)

umask(1)

unalias(1)

uname(1)

uncompress(1)

unexpand(1)

unget(1)

unhash(1)

unifdef(1)

uniq(1)

units(1)

unix2dos(1)

unlimit(1)

unpack(1)

unset(1)

unsetenv(1)

until(1)

updatehome(1)

uptime(1)

userattr(1)

users(1B)

uucp(1C)

uudecode(1C)

uuencode(1C)

uuglist(1C)

uulog(1C)

uuname(1C)

uupick(1C)

uustat(1C)

uuto(1C)

uux(1C)

vacation(1)

val(1)

valdate(1)

valgid(1)

valint(1)

valpath(1)

valrange(1)

valstr(1)

valtime(1)

valuid(1)

valyorn(1)

vc(1)

vedit(1)

ver(1)

vgrind(1)

vi(1)

view(1)

vipw(1B)

volcheck(1)

volrmmount(1)

w(1)

wait(1)

wc(1)

what(1)

whatis(1)

whence(1)

whereis(1B)

which(1)

while(1)

who(1)

whoami(1B)

whocalls(1)

whois(1)

write(1)

xargs(1)

xgettext(1)

xstr(1)

yacc(1)

yes(1)

ypcat(1)

ypmatch(1)

yppasswd(1)

ypwhich(1)

zcat(1)

zlogin(1)

zonename(1)

zonestat(1)

请告诉我们如何提高我们的文档:
过于简略
不易阅读或难以理解
重要信息缺失
错误的内容
需要翻译的版本
其他
Your rating has been updated
感谢您的反馈!

您的反馈将非常有助于我们提供更好的文档。 您是否愿意参与我们的内容改进并提供进一步的意见?

login

- sign on to the system

用法概要

login [-p] [-d device] [-R repository] [-s service] 
     [-t terminal] [-u identity] [-U ruser] 
     [-h hostname [terminal] | -r hostname] 
     [name [environ]...]

描述

The login command is used at the beginning of each terminal session to identify oneself to the system. login is invoked by the system when a connection is first established, after the previous user has terminated the login shell by issuing the exit command.

Login cannot be invoked as a command, except by the superuser.

If login is invoked as a command, it must replace the initial command interpreter. To invoke login in this fashion, type:

exec login

from the initial shell. The C shell and Korn shell have their own built-ins of login. See ksh(1), ksh88(1), and csh(1) for descriptions of login built-ins and usage.

login asks for your user name, if it is not supplied as an argument, and your password, if appropriate. Where possible, echoing is turned off while you type your password, so it does not appear on the written record of the session.

If you make any mistake in the login procedure, the message:

Login incorrect

is printed and a new login prompt appears. If you make five incorrect login attempts, all five can be logged in /var/adm/loginlog, if it exists. The TTY line is dropped.

If password aging is turned on and the password has aged (see passwd(1) for more information), the user is forced to change the password. In this case the /etc/nsswitch.conf file is consulted to determine password repositories (see nsswitch.conf(4)). The password update configurations supported are limited to the following five cases.

Failure to comply with the configurations prevents the user from logging onto the system because passwd(1) fails. If you do not complete the login successfully within a certain period of time, it is likely that you are silently disconnected.

After a successful login, accounting files are updated. Device owner, group, and permissions are set according to the contents of the /etc/logindevperm file, and the time you last logged in is printed (see logindevperm(4)).

The user-ID, group-ID, supplementary group list, and working directory are initialized, and the command interpreter is started.

The basic environment is initialized to:

HOME=your-login-directory
LOGNAME=your-login-name
PATH=/usr/bin:
SHELL=last-field-of-passwd-entry
MAIL=/var/mail/
TZ=timezone-specification

For Bourne shell and Korn shell logins, the shell executes /etc/profile and $HOME/.profile, if it exists.

For the ksh Korn shell, an interactive shell then executes /etc/ksh.kshrc, followed by the file specified by the ENV environment variable. If $ENV is not set, this defaults to $HOME/.kshrc. For the ksh and /usr/xpg4/bin/sh Korn Shell, an interactive shell executes the file named by $ENV (no default).

For C shell logins, the shell executes /etc/.login, $HOME/.cshrc, and $HOME/.login. The default /etc/profile and /etc/.login files check quotas (see quota(1M)), print /etc/motd, and check for mail. None of the messages are printed if the file $HOME/.hushlogin exists. The name of the command interpreter is set to - (dash), followed by the last component of the interpreter's path name, for example, -sh.

If the login-shell field in the password file (see passwd(4)) is empty, then the default command interpreter, /usr/bin/sh, is used. If this field is * (asterisk), then the named directory becomes the root directory. At that point, login is re-executed at the new level, which must have its own root structure.

The environment can be expanded or modified by supplying additional arguments to login, either at execution time or when login requests your login name. The arguments can take either the form xxx or xxx=yyy. Arguments without an = (equal sign) are placed in the environment as:

Ln=xxx

where n is a number starting at 0 and is incremented each time a new variable name is required. Variables containing an = (equal sign) are placed in the environment without modification. If they already appear in the environment, then they replace the older values.

There are two exceptions: The variables PATH and SHELL cannot be changed. This prevents people logged into restricted shell environments from spawning secondary shells that are not restricted. login understands simple single-character quoting conventions. Typing a \ (backslash) in front of a character quotes it and allows the inclusion of such characters as spaces and tabs.

Alternatively, you can pass the current environment by supplying the -p flag to login. This flag indicates that all currently defined environment variables should be passed, if possible, to the new environment. This option does not bypass any environment variable restrictions mentioned above. Environment variables specified on the login line take precedence, if a variable is passed by both methods.

To enable remote logins by root, edit the /etc/default/login file by inserting a # (pound sign) before the CONSOLE=/dev/console entry. See FILES.

安全

For accounts in the files (passwd(4) and shadow(4)) name service, or the ldap name service, when configured with enableShadowUpdate true, the account can be configured to be automatically locked if successive failed login attempts equals or exceeds the configured value. See ldapclient(1M), user_attr(4), policy.conf(4), and pam_unix_auth(5).

The login command uses pam(3PAM) for authentication, account management, session management, and password management. The PAM configuration policy, listed in either /etc/pam.conf or /etc/pam.d/login, specifies the modules to be used for login. Here is a partial pam.conf file with entries for the login command using the UNIX authentication, account management, and session management modules:

login  auth       required  pam_authtok_get.so.1
login  auth       required  pam_dhkeys.so.1
login  auth       required  pam_unix_auth.so.1
login  auth       required  pam_dial_auth.so.1

login  account    requisite pam_roles.so.1
login  account    required  pam_unix_account.so.1

login  session    required  pam_unix_session.so.1

The equivalent PAM configuration in /etc/pam.d/ would be the following entries in /etc/pam.d/login:

auth     required  pam_authtok_get.so.1
auth     required  pam_dhkeys.so.1
auth     required  pam_unix_auth.so.1
auth     required  pam_dial_auth.so.1
account  requisite pam_roles.so.1
account  required  pam_unix_account.so.1

session  required  pam_unix_session.so.1

The Password Management stack in /etc/pam.conf typically looks like the following:

other  password   required   pam_dhkeys.so.1
other  password   requisite  pam_authtok_get.so.1
other  password   requisite  pam_authtok_check.so.1
other  password   required   pam_authtok_store.so.1

If there are no entries for a PAM service in /etc/pam.conf and /etc/pam.d/service then the entries for the “other” service in /etc/pam.conf are used. If there are not any entries in /etc/pam.conf for the “other” service, then the entries in /etc/pam.d/other will be used. If multiple authentication modules are listed, then the user can be prompted for multiple passwords.

When login is invoked through rlogind or telnetd, the service name used by PAM is rlogin or telnet, respectively.

选项

The following options are supported:

-d device

login accepts a device option, device. device is taken to be the path name of the TTY port login is to operate on. The use of the device option can be expected to improve login performance, since login does not need to call ttyname(3C). The -d option is available only to users whose UID and effective UID are root. Any other attempt to use -d causes login to quietly exit.

-h hostname [terminal]

Used by in.telnetd(1M) to pass information about the remote host and terminal type.

Terminal type as a second argument to the -h option should not start with a hyphen (-).

-p

Used to pass environment variables to the login shell.

-r hostname

Used by in.rlogind(1M) to pass information about the remote host.

-R repository

Used to specify the PAM repository that should be used to tell PAM about the “identity” (see option -u below). If no “identity” information is passed, the repository is not used.

-s service

Indicates the PAM service name that should be used. Normally, this argument is not necessary and is used only for specifying alternative PAM service names. For example: “ktelnet” for the Kerberized telnet process.

-u identity

Specifies the “identity” string associated with the user who is being authenticated. This usually is not be the same as that user's Unix login name. For Kerberized login sessions, this is the Kerberos principal name associated with the user.

-U ruser

Indicates the name of the person attempting to login on the remote side of the rlogin connection. When in.rlogind(1M) is operating in Kerberized mode, that daemon processes the terminal and remote user name information prior to invoking login, so the “ruser” data is indicated using this command line parameter. Normally (non-Kerberos authenticated rlogin), the login daemon reads the remote user information from the client.

退出状态

The following exit values are returned:

0

Successful operation.

non-zero

Error.

文件

$HOME/.cshrc

Initial commands for each csh.

$HOME/.hushlogin

Suppresses login messages.

$HOME/.kshrc

User's commands for interactive ksh, if $ENV is unset; executes after /etc/ksh.kshrc.

$HOME/.login

User's login commands for csh.

$HOME/.profile

User's login commands for sh and ksh.

$HOME/.rhosts

Private list of trusted hostname/username combinations.

/etc/.login

System-wide csh login commands.

/etc/issue

Issue or project identification.

/etc/ksh.kshrc

System-wide commands for interactive ksh.

/etc/logindevperm

Login-based device permissions.

/etc/motd

Message-of-the-day.

/etc/nologin

Message displayed to users attempting to login during machine shutdown.

/etc/passwd

Password file.

/etc/profile

System-wide sh and ksh login commands.

/etc/shadow

List of users' encrypted passwords.

/usr/bin/sh

User's default command interpreter.

/var/adm/lastlog

Time of last login.

/var/adm/loginlog

Record of failed login attempts.

/var/adm/utmpx

Accounting.

/var/adm/wtmpx

Accounting.

/var/mail/your-name

Mailbox for user your-name.

/etc/default/login

Default value can be set for the following flags in /etc/default/login. Default values are specified as comments in the /etc/default/login file, for example, TIMEZONE=EST5EDT.

TIMEZONE

Sets the TZ environment variable of the shell (see environ(5)).

HZ

Sets the HZ environment variable of the shell.

ULIMIT

Sets the file size limit for the login. Units are disk blocks. Default is zero (no limit).

CONSOLE

If set, root can login on that device only. This does not prevent execution of remote commands with rsh(1). Comment out this line to allow login by root.

PASSREQ

Determines if login requires a non-null password.

ALTSHELL

Determines if login should set the SHELL environment variable.

PATH

Sets the initial shell PATH variable.

SUPATH

Sets the initial shell PATH variable for root.

TIMEOUT

Sets the number of seconds (between 0 and 900) to wait before abandoning a login session.

UMASK

Sets the initial shell file creation mode mask. See umask(1).

SYSLOG

Determines whether the syslog(3C) LOG_AUTH facility should be used to log all root logins at level LOG_NOTICE and multiple failed login attempts atLOG_CRIT.

DISABLETIME

If present, and greater than zero, the number of seconds that login waits after RETRIES failed attempts or the PAM framework returns PAM_ABORT. Default is 20 seconds. Minimum is 0 seconds. No maximum is imposed.

SLEEPTIME

If present, sets the number of seconds to wait before the login failure message is printed to the screen. This is for any login failure other than PAM_ABORT. Another login attempt is allowed, providing RETRIES has not been reached or the PAM framework is returned PAM_MAXTRIES. Default is 4 seconds. Minimum is 0 seconds. Maximum is 5 seconds.

Both su(1M) and sulogin(1M) are affected by the value of SLEEPTIME.

RETRIES

Sets the number of retries for logging in (see pam(3PAM)). The default is 5. The maximum number of retries is 15. For accounts configured with automatic locking (see SECURITY above), the account is locked and login exits. If automatic locking has not been configured, login exits without locking the account.

SYSLOG_FAILED_LOGINS

Used to determine how many failed login attempts are allowed by the system before a failed login message is logged, using the syslog(3C) LOG_NOTICE facility. For example, if the variable is set to 0, login logs all failed login attempts.

Of the flags listed in /etc/default/login, sshd(1M) (which see) uses:

  • TIMEZONE

  • HZ

  • ALTSHELL

  • PATH

  • SUPATH

  • CONSOLE

  • PASSREQ

  • UMASK

  • ULIMIT

  • RETRIES

  • SYSLOG_AFTER_FAILED_LOGINS

属性

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Availability
system/core-os
Interface Stability
Committed

另请参见

csh(1), exit(1), ksh(1), ksh88(1), mail(1), mailx(1), newgrp(1), passwd(1), rlogin(1), rsh(1), sh(1), shell_builtins(1), telnet(1), umask(1), in.rlogind(1M), in.telnetd(1M), user_attr(4) and policy.conf(4), logins(1M), quota(1M), sshd(1M), su(1M), sulogin(1M), syslogd(1M), useradd(1M), userdel(1M), pam(3PAM), rcmd(3SOCKET), syslog(3C), ttyname(3C), auth_attr(4), exec_attr(4), hosts.equiv(4), issue(4), logindevperm(4), loginlog(4), nologin(4), nsswitch.conf(4), pam.conf(4), passwd(4), policy.conf(4), profile(4), shadow(4), user_attr(4), utmpx(4), wtmpx(4), attributes(5), environ(5), pam_unix_account(5), pam_unix_auth(5), pam_unix_session(5), pam_authtok_check(5), pam_authtok_get(5), pam_authtok_store(5), pam_dhkeys(5), pam_passwd_auth(5), termio(7I)

诊断

Login incorrect

The user name or the password cannot be matched.

Not on system console

Root login denied. Check the CONSOLE setting in /etc/default/login.

No directory! Logging in with home=/

The user's home directory named in the passwd(4) database cannot be found or has the wrong permissions. Contact your system administrator.

No shell

Cannot execute the shell named in the passwd(4) database. Contact your system administrator.

NO LOGINS: System going down in N minutes

The machine is in the process of being shut down and logins have been disabled.

警告

Users with a UID greater than 76695844 are not subject to password aging, and the system does not record their last login time.

If you use the CONSOLE setting to disable root logins, you should arrange that remote command execution by root is also disabled. See rsh(1), rcmd(3SOCKET), and hosts.equiv(4) for further details.