亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 1780 | 回復: 9
打印 上一主題 下一主題

如何只允許1臺Client可以以root身份登錄V490 Server? [復制鏈接]

論壇徽章:
0
跳轉到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2006-07-11 18:12 |只看該作者 |倒序瀏覽
因為網絡安全的需要,想只允許一臺Client可以以root身份登錄Server,同時禁止其他Client以root身份登錄。如何可以作到,需要在/etc/default/login中定義嗎?謝謝支持!

論壇徽章:
0
2 [報告]
發(fā)表于 2006-07-12 00:05 |只看該作者
用 ssh + tcpwrapper 可以做。

論壇徽章:
0
3 [報告]
發(fā)表于 2006-07-12 09:11 |只看該作者
原帖由 yangsmile 于 2006-7-11 18:12 發(fā)表
因為網絡安全的需要,想只允許一臺Client可以以root身份登錄Server,同時禁止其他Client以root身份登錄。如何可以作到,需要在/etc/default/login中定義嗎?謝謝支持!


So far, I don't have any idea.

On the other hand, 因為網絡安全的需要, root遠程登錄應完全禁止.

論壇徽章:
0
4 [報告]
發(fā)表于 2006-07-12 09:13 |只看該作者
原帖由 susbin 于 2006-7-12 00:05 發(fā)表
用 ssh + tcpwrapper 可以做。


tcpwrapper 不可以指定用戶.

論壇徽章:
0
5 [報告]
發(fā)表于 2006-07-12 09:46 |只看該作者
Agree with chinaux -- root遠程登錄應完全禁止.
However, there's still a way to allow remote login of root user var ssh
from a client with a static IP. We can run two ssh2d. One on port 22 and
the other one on port 122.

論壇徽章:
0
6 [報告]
發(fā)表于 2006-07-12 10:09 |只看該作者
那請問可以應用于此情況的SSH在哪里可以下載?謝謝

論壇徽章:
0
7 [報告]
發(fā)表于 2006-07-12 15:28 |只看該作者
the s/w can be the same, but installed on different locations with different configuration, and will listen to different ports, .e.g. 22/tcp, 2222/tcp.

. disable root logon to 22/tcp.
. configure tcpwrapper for 2222/tcp so that ssh from a specific IP is allowed.

論壇徽章:
1
操作系統(tǒng)版塊每日發(fā)帖之星
日期:2016-01-15 06:20:00
8 [報告]
發(fā)表于 2006-07-12 16:41 |只看該作者
solaris 9以上的版本已經自帶了ssh,只要打開了其功能就行.
還有一種解決辦法,就是用普通用戶登錄后 su - .這樣也可以呀!!
如果有其他人知道你的root用戶密碼和一個普通用戶的密碼,還是可以進去root用戶的環(huán)境的!

論壇徽章:
1
操作系統(tǒng)版塊每日發(fā)帖之星
日期:2016-01-15 06:20:00
9 [報告]
發(fā)表于 2006-07-12 16:42 |只看該作者
這里有一個ssh的安裝使用文檔,可供參考
openssh4.1p1在sparc solaris9下的安裝

所有軟件均來自www.sunfreeware.com

1. 確認所需軟件包

源包地址
The sources for these different programs are on sunfreeware.com or you can go to their home pages at

http://www.zlib.org zlib
http://www.perl.org perl
http://www.aet.tu-cottbus.de/per ... tfix_tls/prngd.html prngd
http://www.openssl.org openssl
http://www.openssh.org openssh
http://www.lothar.com/tech/crypto/ egd
ftp://ftp.porcupine.org/pub/security/index.html tcp_wrappers

從sunfreeware下載的安裝包
openssh-4.1p1-sol9-sparc-local.gz
openssl-0.9.7g-sol9-sparc-local.gz
tcp_wrappers-7.6-sol9-sparc-local.gz (optional, but recommended)
(unless you are using IPV6 - see the tcp_wrappers listing for details on this issue)
zlib-1.2.1-sol9-sparc-local.gz
perl-5.8.5-sol9-sparc-local.gz (optional)
prngd-0.9.25-sol9-sparc-local.gz (optional)
egd-0.8-sol9-sparc-local.gz (optional)

2. 安裝下載的軟件包

With the files downloaded, go to the directory where you put them and run

# gunzip openssh-4.1p1-sol9-sparc-local.gz

# gunzip openssl-0.9.7g-sol9-sparc-local.gz

# gunzip zlib-1.2.2-sol9-sparc-local.gz

# gunzip libgcc-3.3-sol9-sparc-local.gz  (if you don't have gcc 3.3.2 installed)

# gunzip tcp_wrappers-7.6-sol9-sparc-local.gz (again optional)


and optionally for the other packages.  Then run as root

# pkgadd -d openssh-4.1p1-sol9-sparc-local

# pkgadd -d openssl-0.9.7g-sol9-sparc-local

# pkgadd -d zlib-1.2.2-sol9-sparc-local

# pkgadd -d libgcc-3.3-sol9-sparc-local  (if you don't have gcc 3.3.2 installed)

# pkgadd -d tcp_wrappers-7.6-sol9-sparc-local (optional)

可選的那些軟件包也裝了,安裝過程同上

3. sshd用戶的安全設定

# mkdir /var/empty
# chown root:sys /var/empty
# chmod 755 /var/empty
# groupadd sshd
# useradd -g sshd -c 'sshd privsep' -d /var/empty -s /bin/sh sshd

增加了一個系統(tǒng)用戶sshd,預備來啟動sshd進程,sshd用戶的home目錄為/var/empty只有root用戶才有權限

4. sshd的系統(tǒng)啟動關閉腳本的設置

solaris9 自帶的sshd啟動關閉腳本已經非常好了,只要略加改造即可使用新安裝的openssh4.1p1

solaris9 自己的ssh目錄分布如下

/etc/ssh         ;ssh 和sshd的配置文件以及密匙文件
/usr/lib/ssh     :sshd等server端程序文件
/usr/bin/ssh     :ssh等client端程序文件

openssh4.1p1的程序包安裝以后的目錄分布

/usr/local/etc   : ssh 和sshd的配置文件以及密匙文件
/usr/local/sbin  : sshd等server端程序文件
/usr/local/bin   : ssh等client端程序文件

根據上面的分析即可將原有的sshd文件改造成如下

#!/sbin/sh
#
# Copyright (c) 2001 by Sun Microsystems, Inc.
# All rights reserved.
#
# ident "@(#)sshd       1.1     01/09/19 SMI"
#
# If sshd is configured (/etc/ssh/sshd_config exists and is readable),
# the start it up.
# Checks to see if RSA, and DSA host keys are available
# if any of these keys are not present, the respective keys are created.

KEYDIR=/usr/local/etc                       #將以前的/etc/ssh 修改為/usr/local/etc
KEYGEN="/usr/local/bin/ssh-keygen -q"       #將以前的/usr/bin/修改為/usr/local/bin
PIDFILE=/var/run/sshd.pid

case $1 in
'start')
        if [ -x /usr/local/bin/ssh-keygen ]; then             # 將以前的/usr/bin/修改為/usr/local/bin
                if [ ! -f "$KEYDIR/ssh_host_rsa_key" ]; then
                        echo "Creating new RSA public/private host key pair"
                        $KEYGEN -f $KEYDIR/ssh_host_rsa_key -t rsa -N ''
                fi

                if [ ! -f "$KEYDIR/ssh_host_dsa_key" ]; then
                        echo "Creating new DSA public/private host key pair"
                        $KEYGEN -f $KEYDIR/ssh_host_dsa_key -t dsa -N ''
                fi     
        fi

        [ -x /usr/local/sbin/sshd ] && /usr/local/sbin/sshd &       #將以前的/usr/lib/ssh/修改為/usr/local/sbin
        ;;
'stop')
        #
        # If we are switching Run level downwards then we disconnect
        # all connections.
        #
        # Otherwise we just kill the master daemon that is listening
        # and leave the connections active
        if [ -z "$_INIT_RUN_LEVEL" ]; then
                set -- `/usr/bin/who -r`
                _INIT_RUN_LEVEL="$7"
                _INIT_PREV_LEVEL="$9"
        fi
        
        if [ $_INIT_RUN_LEVEL -lt $_INIT_PREV_LEVEL ]; then
                /usr/bin/pkill -u 0 -x sshd
        fi
        if [ -f "$PIDFILE" ]; then
                /usr/bin/kill -TERM `/usr/bin/cat $PIDFILE`
        fi
        ;;

'restart')
        if [ -f "$PIDFILE" ]; then
                /usr/bin/kill -HUP `/usr/bin/cat $PIDFILE`
        fi
        ;;
*)
        echo "Usage: $0 { start | stop }"
        exit 1
        ;;
esac   

5. 原有的 ssh相關文件的善后處理工作

可以刪除原有的sshd軟件包,也可改名處理,這次是改名處理
# cd /usr/bin
# mv ssh-add ssh-add.old
# ln -s /usr/local/bin/ssh-add ssh-add
# mv ssh-agent ssh-agent.old
# mv ssh-keygen ssh-keygen.old
# ln -s /usr/local/bin/ssh-agent ssh-agent
# ln -s /usr/local/bin/ssh-keygen ssh-keygen     
# ln -s /usr/local/bin/ssh-keyscan ssh-keyscan
# mv /usr/bin/sftp /usr/bin/sftp.od
# ln -s /usr/local/bin/sftp /usr/bin/sftp

sshd文件是通過sshd腳本的來啟動的,所以沒有改動。

可能openssh4.1p1的編譯成安裝包默認就認為sshd_config和ssh_config文件就在/usr/local/etc,所以以前的/etc/ssh文件也沒有改名,只是
再也用不到了。

6. tcp_wrappers 的設置工作

其實就是設置/etc/hosts.allow和/etc/hosts.deny,文件格式如下:
sshd: ALL

規(guī)則:如果hosts.allow和hosts.deny存在,只有在hosts.allow里面的條目才能登陸。

改了一下/etc/ssh/sshd_config
AllowTcpForwarding yes   //把原來no改為yes
PermitRootLogin yes     //把原來no改為yes

7. 啟用新的openssh4.1p1

kill -9 殺掉 老的進程,/etc/init.d/sshd start開始新的sshd進程

8. 主要參考了http://www.sunfreeware.com/openssh9.html

論壇徽章:
0
10 [報告]
發(fā)表于 2006-07-12 21:17 |只看該作者
原帖由 chinaux 于 2006-7-12 15:28 發(fā)表
the s/w can be the same, but installed on different locations with different configuration, and will listen to different ports, .e.g. 22/tcp, 2222/tcp.

. disable root logon to 22/tcp.
. configu ...


正解。chinaux 不負其名。
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復

  

北京盛拓優(yōu)訊信息技術有限公司. 版權所有 京ICP備16024965號-6 北京市公安局海淀分局網監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關心和支持過ChinaUnix的朋友們 轉載本站內容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP