private void SSH_Click(object sender, EventArgs e)
{
var connectionInfo = new ConnectionInfo("sftp.foo.com",
"guest",
new PasswordAuthenticationMethod("guest", "pwd"),
new PrivateKeyAuthenticationMethod("rsa.key"));
using (var client = new SftpClient(connectionInfo))
{
client.Connect();
}
}
接続ボタンを押すと、サーバ側で、接続ログが確認できた
Jun 16 10:22:24 ssh-bullseye sshd[1317]: Accepted password for guest from 192.168.0.100 port 55783 ssh2
Jun 16 10:22:24 ssh-bullseye sshd[1317]: pam_unix(sshd:session): session opened for user guest(uid=1000) by (uid=0)
Jun 16 10:22:24 ssh-bullseye systemd-logind[397]: New session 36 of user guest.
Jun 16 10:22:24 ssh-bullseye sshd[1323]: Received disconnect from 192.168.0.100 port 55783:11: Connection terminated by the client.
Jun 16 10:22:24 ssh-bullseye sshd[1323]: Disconnected from user guest 192.168.0.100 port 55783
Jun 16 10:22:24 ssh-bullseye sshd[1317]: pam_unix(sshd:session): session closed for user guest
作成されたフォルダの中身
こんな感じでできてる。
実は、昔作成したアプリケーションは、このdllを流用して作成してた。nugetしてない。
古いDLLを削除してnuget
古いDLLは削除して、nugetで最新の安定板を取得する
これで、最新版の
Renci.SshNet
がインストールされた
無事に起動した。
最新サーバにアクセスしてみると接続できた!
Jun 16 10:34:58 ssh-bullseye sshd[1331]: Accepted password for DESKTOP-GT from 172.21.100.15 port 55876 ssh2
Jun 16 10:34:58 ssh-bullseye sshd[1331]: pam_unix(sshd:session): session opened for user DESKTOP-GT(uid=1385) by (uid=0)
Jun 16 10:34:58 ssh-bullseye systemd-logind[397]: New session 37 of user DESKTOP-GT.
Jun 16 10:34:58 ssh-bullseye systemd: pam_unix(systemd-user:session): session opened for user DESKTOP-GT(uid=1385) by (uid=0)
The DB subnet group doesn’t meet Availability Zone (AZ) coverage requirement. Current AZ coverage: us-west-1a. Add subnets to cover at least 2 AZs. (Service: AmazonRDS; Status Code: 400; Error Code: DBSubnetGroupDoesNotCoverEnoughAZs; Request ID: 664248d6-994b-4ac0-8636-00d81503ee47; Proxy: null)