skip to content

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 pageshow

explore

questions

112 · 5 sections

What does OpenSSH's ssh-agent hold for you, and how do ssh and ssh-add find it through SSH_AUTH_SOCK?

level: juniorimportance: must knowfreq 55%
basics
~20 s

ssh-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.

open as a page

In SSH, what does the server receive and keep for password authentication compared with public-key authentication, and why is the key login safer?

level: juniorimportance: must knowfreq 68%
basics
~20 s

With 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.

open as a page

In OpenSSH's sshd_config, what does the default PermitRootLogin prohibit-password still allow, and why do hardening guides set it to no?

level: juniorimportance: must knowfreq 68%
basics
~20 s

OpenSSH'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.

open as a page

What is an SSH client's first-connection host-key fingerprint prompt asking you to confirm, and what does known_hosts protect against afterwards?

level: juniorimportance: must knowfreq 62%
basics
~20 s

The 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.

open as a page

With OpenSSH, what do local (-L) and remote (-R) port forwarding each do, and which side opens the listening port?

level: juniorimportance: must knowfreq 64%
basics
~20 s

Local 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.

open as a page

Is SFTP just FTP tunnelled through SSH, and why does an SFTP partner link need only TCP port 22 through the firewall?

level: juniorimportance: must knowfreq 55%
basics
~20 s

SFTP 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.

open as a page

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?

level: middleimportance: must knowfreq 45%
basics
~20 s

Ship 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.

open as a page

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?

level: middleimportance: must knowfreq 40%
basics
~20 s

With 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.

open as a page

With OpenSSH's sshd, how do you configure a group of partner accounts that can only use SFTP, each confined to its own directory?

level: middleimportance: must knowfreq 40%
basics
~10 s

Put 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.

open as a page

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?

level: juniorimportance: should knowfreq 30%
basics
~20 s

AutoAddPolicy 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.

open as a page

Why does FTP use a control connection on port 21 plus a separate data connection for every file transfer or directory listing?

level: juniorimportance: must knowfreq 38%
basics
~20 s

FTP 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.

open as a page

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?

level: juniorimportance: must knowfreq 36%
basics
~20 s

FTP 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.

open as a page

What does plain FTP expose to anyone on the network path, and how do FTPS and SFTP each close that gap?

level: juniorimportance: must knowfreq 42%
basics
~10 s

Plain 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.

open as a page

In FTP, what is the difference between active and passive mode, and which side opens the data connection in each?

level: middleimportance: must knowfreq 42%
basics
~20 s

In 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.

open as a page

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?

level: middleimportance: must knowfreq 30%
basics
~20 s

Explicit 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.

open as a page

In RDP, how does Standard RDP Security differ from TLS and CredSSP, and why is it the layer to retire?

level: juniorimportance: must knowfreq 64%
basics
~20 s

Standard 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.

open as a page

What does an RD Gateway do for Remote Desktop users, and why does it keep TCP 3389 off the internet?

level: juniorimportance: must knowfreq 62%
basics
~20 s

An 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.

open as a page

In RDP, what does Network Level Authentication do before a session exists, and why does authenticating first reduce what an unauthenticated client can reach?

level: juniorimportance: must knowfreq 62%
basics
~20 s

Network 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.

open as a page

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?

level: juniorimportance: must knowfreq 68%
basics
~20 s

An 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.

open as a page

In RDP, which virtual channels carry clipboard, drive, printer and audio redirection, and which of them move data out of a session?

level: juniorimportance: must knowfreq 55%
basics
~20 s

A 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.

open as a page

Why do security baselines say SMBv1 must go, and what was Microsoft's March 2017 MS17-010 bulletin about?

level: juniorimportance: must knowfreq 66%
basics
~10 s

SMBv1 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.

open as a page

In SMB on Windows, what are the default administrative shares C$, ADMIN$ and IPC$, and how do you turn the automatic ones off?

level: juniorimportance: must knowfreq 62%
basics
~20 s

C$ and its siblings expose local disks, ADMIN$ is reserved for remote administration, and IPC$ is the pipe share that carries named-pipe RPC. Set-SmbServerConfiguration -AutoShareServer $false -AutoShareWorkstation $false turns off the default server and workstation shares.

open as a page

On a Windows file server, how does SMB signing differ from SMB 3 encryption, and which settings turn each one on?

level: juniorimportance: must knowfreq 62%
basics
~20 s

SMB 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.

open as a page

How do you find out whether any client still uses SMBv1 on a Windows file server before switching it off?

level: middleimportance: must knowfreq 54%
basics
~10 s

On 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.

open as a page

On a Windows SMB file server, how do share-level and file-system permissions differ, and what does a denial of each look like in the audit log?

level: middleimportance: must knowfreq 48%
basics
~20 s

A share has its own access list (Read, Change or Full), checked separately from the ACL on the files. Microsoft's event 5145 page says a failure is logged only for a share-level denial, never for a file-system one.

open as a page