Solaris 10 ftp,telnet,ssh,sendmail

來源:互聯網
上載者:User

1. 管理命令 svcadm (服務狀態管理,啟動、停止等)
# svcs <br>查看當前所有的服務狀態,可以使用|管道符重新導向作更個人化的尋找;如
# svcs |grep online 查看當前運行服務
# svcs |grep offline 查看當前停止服務
# svcs |grep inetd 查看inetd服務狀態

 

2. solaris 10 關閉ftp、telnet、sendmail
#svcadm disable svc:network/ftp
#svcadm disable svc:network/telnet
#svcadm disable svc:network/smtp:sendmail

3. Solaris 修改root 可以Telnet 與ftp
這幾天安裝了Solaris 10 安裝完後發現不可以用root telnet 與 ftp ,
修改 /etc/default/login把CONSOLE=/dev/console該行注釋掉,就可以用root telnet 。
/etc/ftpd/ftpusers,如果有root,行首加#號注釋掉就可以了。


4. Solaris 10開啟SSH服務

Solaris在安裝完畢後就提供了該項服務:OpenSSH
服務的開啟方法:svcadm enbale -rt ssh
預設情況下,OpenSSH是禁止root帳戶通過SSH方式登入的,以保障安全。
方法如下:
修改 /etc/ssh/sshd_config檔案,將其中的“PermitRootLogin no”修改為“PermitRootLogin yes”,再執行 svcadm restart ssh 重新啟動SSH服務。

5. 啟動FTP或查看FTP狀態

預設FTP是關閉的,啟動命令:

# svcadm enable /network/ftp

此時查看FTP服務狀態:

# svcs -l network/ftp

預設情況下,root使用者無法登入,需要修改/etc/ftpd/ftpusers檔案,把root那行前面加個#注釋掉就可以了。

 

6. 重啟SSH

預設SSH是開啟的。但是root使用者無法登入,需要修改/etc/ssh/sshd_config,把裡面的 PermitRootLogin改為 yes,再重啟ssh服務,

重啟命令:

# svcadm restart network/ssh

7. 重啟網卡

以前修改/etc/hosts檔案的IP後都是通過重啟機器來使設定生效的,現在也可以通過下面的命令讓它生效,無需重啟機器。

# svcadm restart physical

8. 如何重新啟動sshd服務

# ps -ef | grep ssh    查詢ssh狀態

root 516 1 0 Dec 27 ? 0:00 /usr/lib/ssh/sshd

root 2006 1728 0 09:52:49 pts/3 0:00 grep ssh

# kill -9 516     終止ssh

# /usr/lib/ssh/sshd   啟動ssh

 

9.

注釋掉/etc/default/login其中CONSOLE=/dev/console 一行,root就可以telnet:

 

# more /etc/default/login
#ident  "@(#)login.dfl  1.14    04/06/25 SMI"
#
# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.

# Set the TZ environment variable of the shell.
#
#TIMEZONE=EST5EDT

# ULIMIT sets the file size limit for the login.  Units are disk blocks.
# The default of zero means no limit.
#
#ULIMIT=0

# If CONSOLE is set, root can only login on that device.
# Comment this line out to allow remote login by root.
#
#CONSOLE=/dev/console

# PASSREQ determines if login requires a password.
#
PASSREQ=YES

# ALTSHELL determines if the SHELL environment variable should be set
#
ALTSHELL=YES

# PATH sets the initial shell PATH variable
#
#PATH=/usr/bin:

# SUPATH sets the initial shell PATH variable for root
#
#SUPATH=/usr/sbin:/usr/bin

# TIMEOUT sets the number of seconds (between 0 and 900) to wait before
# abandoning a login session.
#
#TIMEOUT=300

# UMASK sets the initial shell file creation mode mask.  See umask(1).
#
#UMASK=022

# SYSLOG determines whether the syslog(3) LOG_AUTH facility should be used
# to log all root logins at level LOG_NOTICE and multiple failed login
# attempts at LOG_CRIT.
#
SYSLOG=YES

# SLEEPTIME controls the number of seconds that the command should
# wait before printing the "login incorrect" message when a
# bad password is provided.  The range is limited from
# 0 to 5 seconds.
#
#SLEEPTIME=4

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

# RETRIES determines the number of failed logins that will be
# allowed before login exits. Default is 5 and maximum is 15.
# If account locking is configured (user_attr(4)/policy.conf(4))
# for a local user's account (passwd(4)/shadow(4)), that account
# will be locked if failed logins equals or exceeds RETRIES.
#
#RETRIES=5
#
# The SYSLOG_FAILED_LOGINS variable is used to determine how many failed
# login attempts will be allowed by the system before a failed login
# message is logged, using the syslog(3) LOG_NOTICE facility.  For example,
# if the variable is set to 0, login will log -all- failed login attempts.
#
#SYSLOG_FAILED_LOGINS=5

=========================================================

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.