免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
123下一页
最近访问板块 发新帖
查看: 3133 | 回复: 20
打印 上一主题 下一主题

[学习求职] 高手请进!!不是高手的来学习一下! [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2004-07-08 17:15 |只看该作者 |倒序浏览
1:aix下能不能复制(或再建一个root或root权限的用户)。这个在UNIX里人 人都会,可AIX在C2安全级,小弟不会!
2:请教rcp的用法,写的越详细越好。


这是求助贴:不是诚心讨论问题和学习问题的请不要跟贴!!谢谢!!

论坛徽章:
0
2 [报告]
发表于 2004-07-08 17:29 |只看该作者

高手请进!!不是高手的来学习一下!

高手来啊,小弟候着呢!!

论坛徽章:
0
3 [报告]
发表于 2004-07-08 17:37 |只看该作者

高手请进!!不是高手的来学习一下!

rcp Command


Purpose
Transfers files between a local and a remote host or between two remote hosts.



Syntax

rcp [ -p] [ -F] [ -k realm ] { { User@Host:File | Host:File | File } { User@Host:File | Host:File | File | User@Hostirectory | Hostirectory | Directory } | [ -r] { User@Hostirectory | Hostirectory |Directory } { User@Hostirectory | Hostirectory | Directory } }


Description
The /usr/bin/rcp command is used to copy one or more files between the local host and a remote host, between two remote hosts, or between files at the same remote host.

Remote destination files and directories require a specified Host: parameter. If a remote host name is not specified for either the source or the destination, the rcp command is equivalent to the cp command. Local file and directory names do not require a Host: parameter.


Note: The rcp command assumes that a : (colon) terminates a host name. When you want to use a : in a filename, use a / (slash) in front of the filename or use the full path name, including the /.
If a Host is not prefixed by a User@ parameter, the local user name is used at the remote host. If a User@ parameter is entered, that name is used.

If the path for a file or directory on a remote host is not specified or is not fully qualified, the path is interpreted as beginning at the home directory for the remote user account. Additionally, any metacharacters that must be interpreted at a remote host must be quoted using a \ (backslash), a " (double quotation mark), or a ' (single quotation mark).


File Permissions and Ownership
By default, the permissions mode and ownership of an existing destination file are preserved. Normally, if a destination file does not exist, the permissions mode of the destination file is equal to the permissions mode of the source file as modified by the umask command (a special command in the Korn shell) at the destination host. If the rcp command -p flag is set, the modification time and mode of source files are preserved at the destination host.

The user name entered for the remote host determines the file access privileges the rcp command uses at that host. Additionally, the user name given to a destination host determines the ownership and access modes of the resulting destination file or files.


Using Standard Authentication
The remote host allows access if one of the following conditions is satisfied:

The local host is included in the remote host /etc/hosts.equiv file and the remote user is not the root user.
The local host and user name is included in a $HOME/.rhosts file on the remote user account.
Although you can set any permissions for the $HOME/.rhosts file, it is recommended that the permissions of the .rhosts file be set to 600 (read and write by owner only).

In addition to the preceding conditions, the rcp command also allows access to the remote host if the remote user account does not have a password defined. However, for security reasons, the use of a password on all user accounts is recommended.


For Kerberos 5 Authentication
The remote host allows access only if all of the following conditions are satisfied:

The local user has current DCE credentials.
The local and remote systems are configured for Kerberos 5 authentication (On some remote systems, this may not be necessary. It is necessary that a daemon is listening to the klogin port).
The remote system accepts the DCE credentials as sufficient for access to the remote account. See the kvalid_user function for additional information.

rcp and Named Pipelines
Do not use the rcp command to copy named pipelines, or FIFOs, (special files created with the mknod -p command). The rcp command uses the open subroutine on the files that it copies, and this subroutine blocks on blocking devices like a FIFO pipe.


Restrictions
The SP Kerberos V4 rcp execution path does not support remote-to-remote copy as Kerberos does not support forwarding credentials. The message you would receive under these circumstances is the message indicating you do not have tickets and must use kinit to login. The message would be issued from the remote source machine. Please see the example below for using Kerberos to perform a remote-to-remote copy.


Flags

-p  Preserves the modification times and modes of the source files in the copies sent to the destination only if the user has root authority or is the owner of the destination. Without this flag, the umask command at the destination modifies the mode of the destination file, and the modification time of the destination file is set to the time the file is received.
When this flag is not used, the umask being honored is the value stored in the appropriate database. It is not the value that is set by issuing the umask command. The permission and ownership values that result from the umask command do not affect those stored in the database.

-r  Recursively copies, for directories only, each file and subdirectory in the source directory into the destination directory.  
-F  Causes the credentials to be forwarded. In addition, the credentials on the remote system will be marked forwardable (allowing them to be passed to another remote system). This flag will be ignored if Kerberos 5 is not the current authentication method. Authentication will fail if the current DCE credentials are not marked forwardable.  
-k realm  Allows the user to specify the realm of the remote station if it is different from the local systems realm. For these purposes, a realm is synonymous with a DCE cell. This flag will be ignored if Kerberos 5 is not the current authentication method.  



Security
The remote host allows access only if at least one of the following conditions is satisfied:

The local user ID is listed as a principal in the authentication database and had performed a kinit to obtain an authentication ticket.
If a $HOME/.klogin file exists, it must be located in the local user's $HOME directory on the target system. The local user must be listed as well as any users or services allowed to rsh into this account. This file performs a similar function to a local .rhosts file. Each line in this file should contain a principal in the form of "principal.instance@realm." If the originating user is authenticated as one of the principals named in .klogin, access is granted to the account. The owner of the account is granted access if there is no .klogin file.
For security reasons, any $HOME/.klogin file must be owned by the remote user and only the AIX owner id should have read and write access (permissions = 600) to .klogin.


Parameters

Host:File  Specifies the host name (Host) and file name (File) of the remote destination file, separated by a : (colon).

Note: Because the rcp command assumes that a : (colon) terminates a host name, you must insert a \ (backslash) before any colons that are embedded in the local file and directory names.  
User@Host:File  Specifies the user name (User@) that the rcp command uses to set ownership of the transferred file, the host name (Host), and file name (File) of the remote destination file. The user name entered for the remote host determines the file access privileges the rcp command uses at that host.  
File  Specifies the file name of the local destination file.  
Hostirectory  Specifies the host name (Host) and directory name (Directory) of the remote destination directory.

Note: Because the rcp command assumes that a : (colon) terminates a host name, you must insert a \ (backslash) before any colons that are embedded in the local file and directory names.  
User@Hostirectory  Specifies the user name (User@) the rcp command uses to set ownership of the transferred file, the host name (Host), and directory name (Directory) of the remote destination directory. The user name entered for the remote host determines the file access privileges the rcp command uses at that host.  
Directory  The directory name of the local destination directory.  



Exit Status
This command returns the following exit values:
0  Successful completion.  
>;0  An error occurred.  



Examples
In the following examples, the local host is listed in the /etc/hosts.equiv file at the remote host.

To copy a local file to a remote host, enter:

rcp localfile host2:/home/eng/jane

The file localfile from the local host is copied to the remote host host2.

To copy a remote file from one remote host to another remote host, enter:  

rcp host1:/home/eng/jane/newplan host2:/home/eng/mary

The file /home/eng/jane/newplan is copied from remote host host1 to remote host host2.

To send the directory subtree from the local host to a remote host and preserve the modification times and modes, enter:
rcp  -p  -r report jane@host2:report
The directory subtree report is copied from the local host to the home directory of user jane at remote host host2 and all modes and modification times are preserved. The remote file /home/jane/.rhosts includes an entry specifying the local host and user name.
This example shows how the root user can issue an rcp on a remote host when the authentication is Kerberos 4 on both the target and server. The root user must be in the authentication database and must have already issued kinit on the local host. The command is issued at the local host to copy the file, stuff, from node r05n07 to node r05n05 on an SP.
/usr/lpp/ssp/rcmd/bin/rsh r05n07 'export KRBTKTFILE=/tmp/rcmdtkt$$; \
/usr/lpp/ssp/rcmd/bin/rcmdtgt; \
/usr/lpp/ssp/rcmd/bin/rcp /tmp/stuff r05n05:/tmp/stuff;'

The root user sets the KRBTKTFILE environment variable to the name of a temporary ticket-cache file and then obtains a service ticket by issuing the rcmdtgt command. The rcp uses the service ticket to authenticate from host r05n07 to host r05n05.

论坛徽章:
0
4 [报告]
发表于 2004-07-08 17:40 |只看该作者

高手请进!!不是高手的来学习一下!

晕,老大,不要把MAN文档贴出来,看不下去,累脑子!!

论坛徽章:
0
5 [报告]
发表于 2004-07-08 17:55 |只看该作者

高手请进!!不是高手的来学习一下!

晕死,你自己不是说越细越好?

论坛徽章:
0
6 [报告]
发表于 2004-07-08 18:13 |只看该作者

高手请进!!不是高手的来学习一下!

晕倒,老大,要是要这个我也不用发贴出来啊!懂的话就自己写出个例子来!!

论坛徽章:
0
7 [报告]
发表于 2004-07-08 18:32 |只看该作者

高手请进!!不是高手的来学习一下!

晕,例子还不多啊?这么多例子,你还嫌少?晕死啦。

论坛徽章:
0
8 [报告]
发表于 2004-07-08 20:32 |只看该作者

高手请进!!不是高手的来学习一下!

原帖由 "QU2CN" 发表:
1:aix下能不能复制(或再建一个root或root权限的用户)。这个在UNIX里人 人都会,可AIX在C2安全级,小弟不会!
2:请教rcp的用法,写的越详细越好。


1、you can use the command  vi to edit the /etc/passwd file and config new user id to zero .  This is the answer to your first question .

2、you can use the man rcp to get the most detail answer .

btw :  AIX also belong to  a unix  .  …………

论坛徽章:
0
9 [报告]
发表于 2004-07-08 21:18 |只看该作者

高手请进!!不是高手的来学习一下!

老大,能不能用汉语啊!“把user id 改成0“是什么意思?!!

论坛徽章:
0
10 [报告]
发表于 2004-07-08 21:34 |只看该作者

高手请进!!不是高手的来学习一下!

[quote]原帖由 "QU2CN"]老大,能不能用汉语啊!“把user id 改成0“是什么意思?!![/quote 发表:


看来你基础还真要好好补补了,多多看书吧,这都是UNIX里基础的东西了。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP