4 ms·
It's one thing to work under root sometimes, and it's another thing entirely to work in the root directory. I'm still trying to understand how the file upload s
by BrandonM 17y ago
It's one thing to work under root sometimes, and it's another thing entirely to work in the root directory. I'm still trying to understand how the file upload sent a bunch of images into the root directory. I would undoubtedly have scp'd or ftp'd the files to either my home directory or the standard ftp directory with user permissions, and then I would have moved the images to where they belong (as root if necessary).
Still, you had some good points. The information on explicitly indicating the library directory is good. Most important of all is the lesson to double check any mv, rm, and splat-completing command that is run as root (or under sudo, for you sudo junkies out there). Personally when I'm using a * in a root command, I first add "echo " to the beginning of the line so that I am sure of what is going to happen before I execute it.
- blhack 17y agoI was being incredibly lazy and did the following: pscp *.jpg root@gibsonandlily.com:/ This was monumentally stupid, I know. Looking on the bright side of things, however, I learned my lesson :).
- BrandonM 17y agoYou know that if you just left the slash off, the files go into root's home directory (typically /root/)? On a separate note, I tend to disable root SSH access on my servers. I SSH as a user and then when necessary, I'll su to root. Not only does that kill the temptation to use root as the default login, it also makes it doubly-hard to get to root as far as password-stealing goes.