File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -180,14 +180,14 @@ <h1>php<span class="red">sec</span>lib: SSH2 Examples and Notes</h1>
180
180
echo $ssh-> exec('pwd'); // (despite the previous command) outputs /home/username</ span > < span style ="display: none ">
181
181
</ span > < span class ="interactive "> echo $ssh-> read('username@username:~$');
182
182
$ssh-> write("ls -la\n");
183
- echo $ssh-> read('username@username:~$');</ span > < span class ="sudo "> echo $sftp -> read('username@username:~$');
184
- $sftp -> write("sudo ls -la\n");
185
- $output = $sftp -> read('#Password :|username@username:~\$#', NET_SSH2_READ_REGEX);
183
+ echo $ssh-> read('username@username:~$');</ span > < span class ="sudo "> echo $ssh -> read('username@username:~$');
184
+ $ssh -> write("sudo ls -la\n");
185
+ $output = $ssh -> read('#[pP]assword[^:]* :|username@username:~\$#', NET_SSH2_READ_REGEX);
186
186
echo $output;
187
- if (preg_match('#Password :#', $output)) {
187
+ if (preg_match('#[pP]assword[^:]* :#', $output)) {
188
188
$ssh-> write("password\n");
189
- echo $sftp -> read('username@username:~$');
190
- }</ span > < span class ="timeout "> $ssh-> setTimeout(5 );
189
+ echo $ssh -> read('username@username:~$');
190
+ }</ span > < span class ="timeout "> $ssh-> setTimeout(1 );
191
191
echo $ssh-> read();</ span > < span class ="top "> $ansi = new File_ANSI();
192
192
193
193
$ansi-> appendString($ssh-> read('username@username:~$'));
You can’t perform that action at this time.
0 commit comments