The same account for SCP and SFTP

Hi, it is possible to use the same account for SCP and SFTP (sshd) connecting to a server? Or is it technically excluded?

Thanks

Yes – not only possible but common. Can you explain the use case / situation a bit more?

1 Like

At one backup server, I need to have one user access through SCP and SFTP.

User bck → SCP protocol → access to /bck/scp
User bck → SFTP protocol → access to /bck/sftp

The same user needs to backup through two protocol to the same server to two directories.

Why do you need them to access different directories with different protocols? Does it need to be restricted to only those protocols and only those directories?

1 Like

I have two types of IoT boxes. The first type support only SCP protocol and the second type only SFTP protocol. From both types of boxes, I need to back up to my backup server. Optimally with one user account (due to simplicity for users).

Box 1 → SCP protocol → backup to folder /bck/scp
Box 2 → SFTP protocol → backup to folder /bck/sftp

Maybe my idea is bad and a better solution is with two accounts.

I personally would go with one account per system. But, if you want to share, there’s no reason not to. You don’t have to do anything special — both scp and sftp are on by default.

I still would go with /bck/system-name for each individual box though rather than doing it by protocol.

Well, actually, I’d use /srv/bck/system-name or /srv/backup/system-name — that’s what /srv is there for.