SSH2_SHELL(3) 1 SSH2_SHELL(3)ssh2_shell - Request an interactive shellSYNOPSIS
resource ssh2_shell (resource $session, [string $term_type = "vanilla"], [array $env], [int $width = 80], [int $height = 25], [int
$width_height_type = SSH2_TERM_UNIT_CHARS])
DESCRIPTION
Open a shell at the remote end and allocate a stream for it.
PARAMETERS
o $session
- An SSH connection link identifier, obtained from a call to ssh2_connect(3).
o $term_type
-$term_type should correspond to one of the entries in the target system's /etc/termcap file.
o $env
-$env may be passed as an associative array of name/value pairs to set in the target environment.
o $width
- Width of the virtual terminal.
o $height
- Height of the virtual terminal.
o $width_height_type
-$width_height_type should be one of SSH2_TERM_UNIT_CHARS or SSH2_TERM_UNIT_PIXELS.
RETURN VALUES EXAMPLES
Example #1
Executing a command
<?php
$connection = ssh2_connect('shell.example.com', 22);
ssh2_auth_password($connection, 'username', 'password');
$stream = ssh2_shell($connection, 'vt102', null, 80, 24, SSH2_TERM_UNIT_CHARS);
?>
SEE ALSO ssh2_exec(3), ssh2_tunnel(3), ssh2_fetch_stream(3).
PHP Documentation Group SSH2_SHELL(3)
Check Out this Related Man Page
SSH2_AUTH_HOSTBASED_FILE(3) 1 SSH2_AUTH_HOSTBASED_FILE(3)ssh2_auth_hostbased_file - Authenticate using a public hostkeySYNOPSIS
bool ssh2_auth_hostbased_file (resource $session, string $username, string $hostname, string $pubkeyfile, string $privkeyfile, [string
$passphrase], [string $local_username])
DESCRIPTION
Authenticate using a public hostkey read from a file.
PARAMETERS
o $session
- An SSH connection link identifier, obtained from a call to ssh2_connect(3).
o $username
-
o $hostname
-
o $pubkeyfile
-
o $privkeyfile
-
o $passphrase
- If $privkeyfile is encrypted (which it should be), the passphrase must be provided.
o $local_username
- If $local_username is omitted, then the value for $username will be used for it.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
Authentication using a public hostkey
<?php
$connection = ssh2_connect('shell.example.com', 22, array('hostkey'=>'ssh-rsa'));
if (ssh2_auth_hostbased_file($connection, 'remoteusername', 'myhost.example.com',
'/usr/local/etc/hostkey_rsa.pub',
'/usr/local/etc/hostkey_rsa', 'secret',
'localusername')) {
echo "Public Key Hostbased Authentication Successful
";
} else {
die('Public Key Hostbased Authentication Failed');
}
?>
NOTES
Note
ssh2_auth_hostbased_file(3) requires libssh2 >= 0.7 and PHP/SSH2 >= 0.7
PHP Documentation Group SSH2_AUTH_HOSTBASED_FILE(3)
Hi,
Now that I'm going to be using my Mac as a web host, I decided to use the PHP shell.
However, when I type php straight in the terminal, the session freezes.
Is there anything wrong that I'm doing? (3 Replies)
Hi
I'm trying to create a connection with DB from shell script using the following string
sqlplus <user>@<db_instance>/<password>
in which I'm successful.
However, after connecting to DB it is giving me a sql prompt as follows
=====================
Connected to:
Oracle Database 10g... (2 Replies)
Dears,
Newbie here and tried to search this topic for 3 days now with results.
I have a shell array and I want to use it in sqlplus with one connection.
here is what I have for now
#!/bin/ksh
FileName=1000
FileName=2000
FileName=3000
FileName=4000
sqlplus /nolog <<EOF
connect... (20 Replies)
Hi, Here is the issue: Any SSH connection to this server drops in 5 minutes.
# date
Wed Jul 18 17:11:27 GMT 2012 (Note: use GMT)
# grep Alive /etc/ssh/sshd_config
#TCPKeepAlive yes
ClientAliveInterval 60
ClientAliveCountMax 100
# ssh -V
OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul... (9 Replies)