• EnglishSpanishGermanFrenchPolishChinese (Traditional)


EnglishSpanishGermanFrenchPolishChinese (Traditional)

Operating systems, scripting, PowerShell and security

Operating systems, software development, scripting, PowerShell tips, network and security

Menú principal
  • Categorías
  • Cursos
  • Libro de PowerShell
  • Lo mejor
  • Lo último
  • Proyectos
  • Contactar
Ir al contenido

Ejercicios de PowerShell: subir ficheros por SSH instalando Posh-SSH

PowerShell
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
Install-Module -Name Posh-SSH -RequiredVersion 2.0.2
 
New-SSHSession -ComputerName 192.168.1.157 -Credential (Get-Credential)
 
Get-SSHSession
 
(Invoke-SSHCommand -Index 0 "ls" | select output).output
 
echo "hola" > fichero.html
 
Set-SCPFile -LocalFile .\fichero.html -ComputerName 192.168.1.157 -RemotePath . -Credential (Get-Credential)
 
Invoke-SSHCommand -Index 0 "ls fichero.html"
Invoke-SSHCommand -Index 0 "ls -la index.html"

Publicado el día 22 de febrero de 2021

CATEGORÍAS

PowerShell, Red

ETIQUETAS

Echo, Ejercicios de PowerShell, Get-Credential, HTML, Invoke-SSHCommand, Jesús Niño, Jesús Niño Camazón, ls, Module, Set-SCPFile, SSH

MÁS

  • Ejercicios de seguridad: práctica sobre virus
  • Ejercicios de PowerShell: crear mediante scripts una estructura de una red con un dominio y las configuraciones de GPOS que necesites
  • Pedir el nombre de un proceso y mostrar información del proceso mediante PowerShell con Node-PowerShell, EJS (Embedded JavaScript), Body-parser y Express
  • Ejercicios de PowerShell: ejercicios básicos sobre el sistema de archivos en PowerShell
  • Instalación, configuración y uso de servicios de acceso y administración remota
  • Instalar y ejecutar SSH para PowerShell