FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
ssh-python/libssh/examples/libsshpp.cpp at trace · ParallelSSH/ssh-python · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
ParallelSSH
/
ssh-python
Public
Notifications
You must be signed in to change notification settings
Fork
29
Star
48
Code
Issues
1
Pull requests
1
Discussions
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Security and quality
Insights
Expand file tree
Breadcrumbs
ssh-python
/
libssh
/
examples
/
libsshpp.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
33 lines (28 loc) · 877 Bytes
Breadcrumbs
ssh-python
/
libssh
/
examples
/
libsshpp.cpp
Copy path
File metadata and controls
33 lines (28 loc) · 877 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
Copyright 2010 Aris Adamantiadis
This file is part of the SSH Library
You are free to copy this file, modify it in any way, consider it being public
domain. This does not apply to the rest of the library though, but it is
allowed to cut-and-paste working code from this file to any license of
program.
*/
/*
This file demonstrates the use of the C++ wrapper to libssh
*/
#
include
<
iostream
>
#
include
<
string
>
#
include
<
libssh/libsshpp.hpp
>
int
main
(
int
argc,
const
char
**argv){
ssh::Session session;
try
{
if
(argc>
1
)
session.
setOption
(
SSH_OPTIONS_HOST
,argv[
1
]);
else
session.
setOption
(
SSH_OPTIONS_HOST
,
"
localhost
"
);
session.
connect
();
session.
userauthPublickeyAuto
();
session.
disconnect
();
}
catch
(ssh::SshException e){
std::cout <<
"
Error during connection :
"
;
std::cout << e.
getError
() << std::endl;
}
return
0
;
}
Back
|
FazBrowse Home
|
New Git URL