IBM Sterling B2B: Criando um SFTP Server Adapter: Difference between revisions

From Wiki
No edit summary
No edit summary
 
(22 intermediate revisions by the same user not shown)
Line 1: Line 1:
Abaixo descrevo como configurar um SFTP Server Adapter
[[File:sftp-server-adapter.png]]
Dica:
Ao criar um recurso no B2Bi tente definir uma nomenclatura que te auxilie a encontrar e exportar os dados. Como:
<Empresa>_<Projeto/Serviço>_<Tipo do Server Adapter>_serveradapter_<PORTA>
Neste exemplo utilizo o seguinte
customer_projectx_sftp_serveradapter_5022
= Procedimento =
== Configurar o SSH Host Key ==
1) No Dashboard do B2Bi, clique no menu '''Deployment > SSH Host Identity Key'''
2) Em ''Create'', clique no botão '''Go!'''
3) Informe os dados e clique em '''Next'''
* Host Name: '''customer_sfgb2b_production_hostkey'''
* Key Type: '''ssh-rsa'''
* Key Length: '''2048'''
* Key Comment: '''hostkey for production environment'''
* Enabled: selecionar
Figura ilustrativa:
[[File:b2b_create_hostkey_01.png]]
4) Confirme os dados e clique em '''Finish'''
Figura ilustrativa:
[[File:b2b_create_hostkey_02.png]]
== Configurar o Service Adapter ==
1) No Dashboard do B2Bi, clique no menu '''Deployment > Services > Configuration'''
1) No Dashboard do B2Bi, clique no menu '''Deployment > Services > Configuration'''


2) Em ''Select Service type'', informe abaixo e clique em '''Next'''
2) Em ''Select Service type'', informe abaixo e clique em '''Next'''


* Service Type: '''SFTP Server Adapter'''
* Service Type: '''SFTP Server Adapter 2.0'''


3) Em ''SFTP Server Adapter: Name'', informe abaixo e clique em '''Next'''
3) Em ''SFTP Server Adapter: Name'', informe abaixo e clique em '''Next'''


* Name: '''projectx_sftp_server'''
* Name: '''customer_projectx_sftp_serveradapter_5022'''
* Description: '''SFTP Server for ProjectX'''
* Description: '''SFTP Server for ProjectX'''
* Environment: '''node1'''
* Environment: '''node1'''
* Select a group: '''None'''
* Select a group: '''Create a Group''' e '''customer_sftp_sa_group'''


4) Em ''projectx_sftp_server: Configuration'', informe abaixo e clique em '''Next'''
4) Em ''customer_projectx_sftp_serveradapter_5022: Configuration'', informe abaixo e clique em '''Next'''


* Perimeter Server: '''node1 & local'''
* Perimeter Server: '''node1 & local'''
* Enabled Protocols: '''SFTP and SCP'''
* Enabled Protocols: '''SFTP and SCP'''
* SFTP Server Listen Port: '''10022'''
* Host Identity Key: '''<INFORMAR_A_HOST_IDENTITY_KEY_CRIADO_ANTERIORMENTE>'''
* Payload Repository || '''Mailbox''' ||
* SFTP Server Listen Port: '''5022'''
* Payload Repository: '''Mailbox'''


5) Em ''projectx_sftp_server: Configuration: Document Storage'', informe abaixo e clique em '''Next'''
5) Em ''customer_projectx_sftp_serveradapter_5022: Configuration: Document Storage'', informe abaixo e clique em '''Next'''


* Document Storage: '''File System'''
* Document Storage: '''File System'''
* Support for concurrent duplicate-named file transfers: '''Limited'''
* Support for concurrent duplicate-named file transfers: '''Limited'''


6) Em ''projectx_sftp_server: Add Policies'', clique em '''Next'''
6) Em ''customer_projectx_sftp_serveradapter_5022: Add Policies'', clique em '''Next'''


7) Em ''projectx_sftp_server: Configuration'', informe abaixo e clique em '''Next'''
7) Em ''projectx_sftp_server: Configuration'', informe abaixo e clique em '''Next'''
Line 31: Line 75:
* Should users start in the directory that matches their user name upon logon?: '''Yes'''
* Should users start in the directory that matches their user name upon logon?: '''Yes'''


8) Em ''projectx_sftp_server: Extractability'', clique em '''Next'''
8) Em ''customer_projectx_sftp_serveradapter_5022: Extractability'', clique em '''Next'''


9) Confirme os dados e clique em '''Finish'''
9) Confirme os dados e clique em '''Finish'''
Figura Ilustrativa:


[[File:sftp_adapter_config2.png]]
[[File:sftp_adapter_config2.png]]
== Testando o SFTP Server Adapter==
1) Abrir um terminal
2) Criar um arquivo de exemplo
touch example.txt
3) Conectando ao nosso adapter e submetendo um arquivo
'''sftp -P 5022 <nowiki><user_at_sterling>@<sfg_b2b_hostname></nowiki>'''
Aceite a nova chave:
sftp -P 5022 <nowiki>[email protected]</nowiki>
The authenticity of host '[10.0.0.1]:5022 ([10.0.0.1]:5022)' can't be established.
RSA key fingerprint is SHA256:1u/hMWA4C/YF9o2CUUUhdAc1rzPL9/IxZYUnGhnon3c.
RSA key fingerprint is MD5:4a:dd:62:72:db:65:ac:17:26:0f:34:1e:56:a0:e8:46.
Are you sure you want to continue connecting (yes/no)? '''yes'''
Informe a senha:
Warning: Permanently added '[10.0.0.1]:5022' (RSA) to the list of known hosts.
SSH Server supporting SFTP only
[email protected]'s password:
Connected to 10.0.0.1.
Listando o diretório remoto:
sftp> pwd
Remote working directory: /
sftp> ls
sub1  sub2  sub3 
Listando o diretório local:
sftp>
sftp> lcd /tmp
sftp> lls
example.txt
Enviando o arquivo:
sftp> put example.txt
Uploading example.txt to /example.txt
example.txt    100%  0 0.0KB/s 00:00
Encerrando a conexão:
                                                                                                                                                                     
sftp> quit
Verificando na mailbox
[[File:mailfile_uploaded_file.png]]
= Ver também =
* [[Sterling B2B: Criando um SFTP Server Adapter]]
* [[IBM Sterling B2B: Usando um SFTP Server Adapter]]
* [[IBM Sterling| Artigos sobre IBM Sterling]]
* [[Tecnologias|  Mais Artigos sobre Cloud / WebDev / Tecnologias]]
[[Category:IBM Sterling]]
[[Category:B2B]]
[[Category:B2B Integrator]]

Latest revision as of 19:53, 15 October 2020

Abaixo descrevo como configurar um SFTP Server Adapter

Dica:

Ao criar um recurso no B2Bi tente definir uma nomenclatura que te auxilie a encontrar e exportar os dados. Como:

<Empresa>_<Projeto/Serviço>_<Tipo do Server Adapter>_serveradapter_<PORTA> 

Neste exemplo utilizo o seguinte

customer_projectx_sftp_serveradapter_5022


Procedimento

Configurar o SSH Host Key

1) No Dashboard do B2Bi, clique no menu Deployment > SSH Host Identity Key

2) Em Create, clique no botão Go!

3) Informe os dados e clique em Next

  • Host Name: customer_sfgb2b_production_hostkey
  • Key Type: ssh-rsa
  • Key Length: 2048
  • Key Comment: hostkey for production environment
  • Enabled: selecionar

Figura ilustrativa:

4) Confirme os dados e clique em Finish

Figura ilustrativa:

Configurar o Service Adapter

1) No Dashboard do B2Bi, clique no menu Deployment > Services > Configuration

2) Em Select Service type, informe abaixo e clique em Next

  • Service Type: SFTP Server Adapter 2.0

3) Em SFTP Server Adapter: Name, informe abaixo e clique em Next

  • Name: customer_projectx_sftp_serveradapter_5022
  • Description: SFTP Server for ProjectX
  • Environment: node1
  • Select a group: Create a Group e customer_sftp_sa_group

4) Em customer_projectx_sftp_serveradapter_5022: Configuration, informe abaixo e clique em Next

  • Perimeter Server: node1 & local
  • Enabled Protocols: SFTP and SCP
  • Host Identity Key: <INFORMAR_A_HOST_IDENTITY_KEY_CRIADO_ANTERIORMENTE>
  • SFTP Server Listen Port: 5022
  • Payload Repository: Mailbox

5) Em customer_projectx_sftp_serveradapter_5022: Configuration: Document Storage, informe abaixo e clique em Next

  • Document Storage: File System
  • Support for concurrent duplicate-named file transfers: Limited

6) Em customer_projectx_sftp_serveradapter_5022: Add Policies, clique em Next

7) Em projectx_sftp_server: Configuration, informe abaixo e clique em Next

  • Should the adapter be restricted to a certain group of users?: No
  • Should users start in the directory that matches their user name upon logon?: Yes

8) Em customer_projectx_sftp_serveradapter_5022: Extractability, clique em Next

9) Confirme os dados e clique em Finish

Figura Ilustrativa:

Testando o SFTP Server Adapter

1) Abrir um terminal

2) Criar um arquivo de exemplo

touch example.txt

3) Conectando ao nosso adapter e submetendo um arquivo

sftp -P 5022 <user_at_sterling>@<sfg_b2b_hostname>

Aceite a nova chave:

sftp -P 5022 [email protected]
The authenticity of host '[10.0.0.1]:5022 ([10.0.0.1]:5022)' can't be established.
RSA key fingerprint is SHA256:1u/hMWA4C/YF9o2CUUUhdAc1rzPL9/IxZYUnGhnon3c.
RSA key fingerprint is MD5:4a:dd:62:72:db:65:ac:17:26:0f:34:1e:56:a0:e8:46.
Are you sure you want to continue connecting (yes/no)? yes

Informe a senha:

Warning: Permanently added '[10.0.0.1]:5022' (RSA) to the list of known hosts.
SSH Server supporting SFTP only
[email protected]'s password: 
Connected to 10.0.0.1.

Listando o diretório remoto:

sftp> pwd
Remote working directory: /
sftp> ls
sub1  sub2  sub3  

Listando o diretório local:

sftp> 
sftp> lcd /tmp 

sftp> lls
example.txt

Enviando o arquivo:

sftp> put example.txt
Uploading example.txt to /example.txt
example.txt     100%  0 0.0KB/s 00:00

Encerrando a conexão:

sftp> quit


Verificando na mailbox

Ver também