sp_addobjectdef  sp_addsegment

Chapter 1: System Procedures

sp_addremotelogin

Description

Authorizes a new remote server user by adding an entry to master.dbo.sysremotelogins.

Syntax

sp_addremotelogin remoteserver [, loginame [, remotename] ]

Parameters

remoteserver

is the name of the remote server to which the remote login applies. This server must be known to the local server by an entry in the master.dbo.sysservers table, which was created with sp_addserver.

NoteThis manual page uses the term “local server” to refer to the server that is executing the remote procedures run from a “remote server.”

loginame

is the login name of the user on the local server. loginame must already exist in the master.dbo.syslogins table.

remotename

is the name used by the remote server when logging into the local server. All remotenames that are not explicitly matched to a local loginame are automatically matched to a local name. In Example 1 , the local name is the remote name that is used to log in. In Example 2 , the local name is “albert.”

Examples

Example 1

Creates an entry in the sysremotelogins table for the remote server GATEWAY, for purposes of login validation. This is a simple way to map remote names to local names when the local and remote servers have the same users:

sp_addremotelogin GATEWAY

This example results in a value of -1 for the suid column and a value of NULL for the remoteusername in a row of sysremotelogins.

Example 2

Creates an entry that maps all logins from the remote server GATEWAY to the local user name “albert”. Adaptive Server adds a row to sysremotelogins with Albert’s server user ID in the suid column and a null value for the remoteusername:

sp_addremotelogin GATEWAY, albert

For these logins to be able to run RPCs on the local server, they must specify a password for the RPC connection when they log into the local server, or they must be “trusted” on the local server. To define these logins as “trusted”, use sp_remoteoption.

Example 3

Maps a remote login from the remote user “pogo” on the remote server GATEWAY to the local user “ralph”. Adaptive Server adds a row to sysremotelogins with Ralph’s server user ID in the suid column and “pogo” in the remoteusername column:

sp_addremotelogin GATEWAY, ralph, pogo

Usage

Permissions

Only a System Administrator can execute sp_addremotelogin.

Auditing

Values in event and extrainfo columns from the sysaudits table are:

Event

Audit option

Command or access audited

Information in extrainfo

38

exec_procedure

Execution of a procedure

  • Roles – Current active roles

  • Keywords or options – NULL

  • Previous value – NULL

  • Current value – NULL

  • Other information – All input parameters

  • Proxy information – Original login name, if set proxy in effect

See also

Documents See the System Administration Guide for more information about setting up servers for remote procedure calls and for using “unified login.”

System procedures sp_addlogin, sp_addserver, sp_dropremotelogin, sp_helpremotelogin, sp_helprotect, sp_helpserver, sp_remoteoption

Utility isql





Copyright © 2005. Sybase Inc. All rights reserved. sp_addsegment

View this book as PDF