File Transfer & Remote Access
SSH and the SFTP it carries, FTP and FTPS, RDP and SMB: how each authenticates, encrypts and crosses a firewall. Interviewers probe which ones are safe to expose and which are clear-text relics.
on this pageshowhide
explore
- SSH34 questions
- Key Exchange & Host Keys6 questions
- Authentication Methods6 questions
- Key Agent & Forwarding5 questions
- Port Forwarding and Tunneling5 questions
- Client Config and Multiplexing6 questions
- Server Hardening6 questions
- SFTP14 questions
- SSH Subsystem Integration4 questions
- Requests & Handlesempty
- Security & Hardening5 questions
- Clients & Automation5 questions
- FTP16 questions
- Data Channels & Modes5 questions
- Security and FTPS6 questions
- NAT and Firewall Issues5 questions
- RDP30 questions
- Sessions and Virtual Channels6 questions
- NLA Authentication6 questions
- Encryption and TLS6 questions
- Gateway and Brokering6 questions
- Security Risks and Exposure6 questions
- SMB18 questions
- Dialects & Negotiation6 questions
- Signing Policy & Ciphers6 questions
- Shares & Named Pipes6 questions
questions
112 · 5 sectionsWhat does OpenSSH's ssh-agent hold for you, and how do ssh and ssh-add find it through SSH_AUTH_SOCK?
basics
~20 sssh-agent keeps private keys decrypted in memory, so each passphrase is typed once, and signs authentication data on request without ever handing a key out. ssh and ssh-add reach it through the Unix-domain socket named in SSH_AUTH_SOCK.
In SSH, what does the server receive and keep for password authentication compared with public-key authentication, and why is the key login safer?
basics
~20 sWith SSH password authentication the client sends the password itself, hidden only by the transport encryption, and the server checks it. With public-key authentication the server holds just a public key and verifies a signature, so nothing reusable reaches it.
In OpenSSH's sshd_config, what does the default PermitRootLogin prohibit-password still allow, and why do hardening guides set it to no?
basics
~20 sOpenSSH's default PermitRootLogin prohibit-password still lets root log in with a public key; it only refuses password and keyboard-interactive. Hardening sets no so people log in as themselves and escalate with sudo, leaving a per-person trail.
What is an SSH client's first-connection host-key fingerprint prompt asking you to confirm, and what does known_hosts protect against afterwards?
basics
~20 sThe prompt asks whether the presented host key really belongs to that server. Once accepted, the key is pinned in known_hosts, and a later server presenting a different key, possibly a man-in-the-middle, is refused by default.
With OpenSSH, what do local (-L) and remote (-R) port forwarding each do, and which side opens the listening port?
basics
~20 sLocal forwarding (-L) opens a listener on the client and carries each connection to a destination the SSH server connects to; remote forwarding (-R) makes the server listen and carries each connection back to a destination the client connects to.
Is SFTP just FTP tunnelled through SSH, and why does an SFTP partner link need only TCP port 22 through the firewall?
basics
~20 sSFTP is not FTP over SSH: it is its own binary protocol, started as the sftp subsystem on an SSH session channel. Every request and reply travels inside one encrypted TCP connection, normally to port 22, with no second connection or negotiated port.
For a CI job pushing files with OpenSSH's sftp, how do you pin the SFTP server's host key and what do BatchMode=yes and StrictHostKeyChecking=yes add?
basics
~20 sShip a known_hosts line for the server, obtained from its operator or checked against their fingerprint, and point UserKnownHostsFile at it; StrictHostKeyChecking=yes refuses any other key and BatchMode=yes turns every prompt into an immediate failure.
In OpenSSH's sftp, how does batch mode with sftp -b change error handling, and how should a CI job's batch file use that?
basics
~20 sWith sftp -b, OpenSSH's sftp stops at the first failing file command (put, rename, rm, mkdir and others) and exits non-zero, so the CI step fails; a leading '-' tolerates one line's failure, and authentication must need no typing.
With OpenSSH's sshd, how do you configure a group of partner accounts that can only use SFTP, each confined to its own directory?
basics
~10 sPut the partners in one group and add a Match Group block to sshd_config with ChrootDirectory, ForceCommand internal-sftp and DisableForwarding; the chroot must be root-owned, so each partner writes into a subfolder it owns.
A Paramiko SFTP upload script calls set_missing_host_key_policy(AutoAddPolicy()); what does that do, and how should Paramiko, JSch and ssh2-sftp-client check host keys instead?
basics
~20 sAutoAddPolicy makes Paramiko trust and store any host key it has not seen, so an impostor is accepted silently; load a pinned file and keep the default RejectPolicy, use JSch's setKnownHosts with StrictHostKeyChecking yes, and give ssh2-sftp-client a hostVerifier.
Why does FTP use a control connection on port 21 plus a separate data connection for every file transfer or directory listing?
basics
~20 sFTP keeps commands and replies on a control connection to TCP port 21 and moves file contents and listings over separate data connections. In stream mode, closing the data connection marks end of file, so every transfer needs a new one.
Why is FTP harder to let through a stateful firewall than SSH or HTTPS, and what must the firewall allow for active and passive transfers?
basics
~20 sFTP sends files over separate data connections whose ports, and often addresses, are negotiated inside the control connection on port 21. A firewall must either open a whole port range or read that conversation to admit each one.
What does plain FTP expose to anyone on the network path, and how do FTPS and SFTP each close that gap?
basics
~10 sPlain FTP sends USER, PASS, every command and every file in clear text. FTPS keeps FTP and adds TLS to its connections; SFTP is a separate file protocol that runs inside an SSH connection.
In FTP, what is the difference between active and passive mode, and which side opens the data connection in each?
basics
~20 sIn active FTP the client listens, announces its address with PORT, and the server connects from port 20. In passive FTP the client sends PASV, the server replies 227 with an address and port it listens on, and the client connects.
In explicit FTPS (RFC 4217), what do AUTH TLS, PBSZ 0 and PROT P each do, and how does implicit FTPS on port 990 differ?
basics
~20 sExplicit FTPS starts as plain FTP on port 21: AUTH TLS (reply 234) encrypts the control connection, PBSZ 0 is the required preamble, PROT P encrypts data connections. Implicit FTPS starts TLS at connect, conventionally on 990, outside any RFC.
In RDP, how does Standard RDP Security differ from TLS and CredSSP, and why is it the layer to retire?
basics
~20 sStandard RDP Security is RDP's own legacy layer: RC4 session keys and no server authentication in the sequence itself. TLS and CredSSP hand protection and server authentication to an external protocol, so the legacy layer is the one to retire.
What does an RD Gateway do for Remote Desktop users, and why does it keep TCP 3389 off the internet?
basics
~20 sAn RD Gateway takes the user's connection over HTTPS on port 443, authenticates and authorizes it, then relays the RDP traffic to the internal host. Only the gateway faces the internet; the hosts keep 3389 private.
In RDP, what does Network Level Authentication do before a session exists, and why does authenticating first reduce what an unauthenticated client can reach?
basics
~20 sNetwork Level Authentication runs CredSSP inside TLS, so the client proves its identity before the server sets up an RDP session. A client that fails authentication never reaches the MCS connect exchange or any later RDP phase.
Why is a Windows server answering Remote Desktop on TCP 3389 from the internet treated as an incident route, and what do you fix first?
basics
~20 sAn internet-reachable RDP listener lets strangers try pre-authentication flaws such as BlueKeep and guess passwords around the clock. Remove direct exposure with a gateway or VPN, require NLA and multifactor authentication, and keep the host patched.
In RDP, which virtual channels carry clipboard, drive, printer and audio redirection, and which of them move data out of a session?
basics
~20 sA virtual channel is a named data stream inside the one RDP connection. The clipboard uses CLIPRDR and drives use RDPDR, which also carries printers; audio output uses RDPSND. Clipboard and drives move data both ways.
Why do security baselines say SMBv1 must go, and what was Microsoft's March 2017 MS17-010 bulletin about?
basics
~10 sSMBv1 is the original SMB dialect, superseded by SMB 2 from 2007 and publicly deprecated by Microsoft in 2014. MS17-010 (14 March 2017, Critical) corrected how the SMBv1 server handles specially crafted requests.
On a Windows file server, how does SMB signing differ from SMB 3 encryption, and which settings turn each one on?
basics
~20 sSMB signing adds a signature to every message so tampering is detected, but the data stays readable on the wire. SMB 3 encryption hides the data and also protects its integrity, at a higher CPU cost.
How do you find out whether any client still uses SMBv1 on a Windows file server before switching it off?
basics
~10 sOn Windows, read EnableSMB1Protocol with Get-SmbServerConfiguration, turn on Set-SmbServerConfiguration -AuditSmb1Access $true, and watch event 3000 in the SMBServer\Audit log. Clients log events 32002 or 32000.