0

i was asking myself, if it is unsafe for some reason, to connect to an ssh-server when you are root on the computer that represents the ssh-client. i was googling, but i only found tons of questions and articles talking about not to log in as root on the ssh server.

so, is it ok to execute root@mycomputer:~$ ssh serveruser@serverip

or user@mycomputer:~$ sudo ssh serveruser@serverip ?

edit: @guntberts question, why i would do this: becouse in some situations it would be more convenient or faster.

e.g. you are root on your computer and want to log into a server without switching the user again, or you want to copy or sync something to the server, that only root can read. of course its not neccessary, and when there are security issues it should not be done.

3
  • If you expect your ssh client to be insecure, then you might have an issue. Otherwise there is nothing that could get back to you. Sep 26, 2015 at 11:08
  • 1
    Only thing that comes to mind at the moment is if that user which is connecting to remote end is using SSH agent forwarding. On server he is connecting to that agent could be used by someone with root access and possibly depending on where this agent is authorized to connect re-use it and abuse; for more info check blog.7elements.co.uk/2012/04/… Sep 26, 2015 at 14:36
  • The (to me) obvious question: Why would you do that? ssh-ing into a remote machine has nothing to do with administrating your local machine, so you should not do it as root (local perspective).
    – guntbert
    Sep 26, 2015 at 18:43

1 Answer 1

0

The only problem would be you can proxy a local port under the first 1024 as root vs your non privileged user.

In some cases this is desired issues-setting-up-ssh-tunnel-for-port-80

2
  • thanks for your answer. could you please explain this a bit more verbose or add a link, where i can read further? who would proxy that port? you mean on the server or on the clients computer? sorry, it may be obvious to other people, but i don't understand yet, what you mean.
    – coffeekid
    Sep 27, 2015 at 12:02
  • updated answer to explain. Sep 27, 2015 at 18:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .