This was requested by user @boutdangtime
Back in the old days, people used computers in text environments. This meant there was no graphical user interface. No pretty buttons, no windows, no mouse. There was only a line in which you could type text commands.
Today, the popular operating system “Linux” (Linux is actually just the kernel, but you dont need to care about that) has a thriving community that very much prefers and bases its software around the text command line interface. This is done to allow for more specific tasks to be ran on the machine. The My Cloud product runs a version of Linux called “Debian” (it isn’t pure Debian, but a modified version). Linux (and many other OS’s) emulate this old style text interface in what is called a “terminal”. Terminals run shells, which are interpreters for commands that you type.
In order to see the command line on your My Cloud, (because there is no graphics adapter to connect a monitor to it) you must login to it via SSH. SSH is a way to talk to shells over the network via an encrypted channel.
Here’s how to access SSH on your My Cloud:
- First, login to the My Cloud’s webpage by typing its IP address into your web browser of choice.
- Next, head to the Network tab, and toggle SSH on. You will be given a prompt asking you to acknowledge that modification can void your warranty. Check “accept”. You will also be given a username and password. They will be
root
andwelc0me
. - Now, you need to actually open an SSH client program to connect to the SSH server on your My Cloud. Depending on your OS, you have a few options.
If you are on Mac OS X, you will already have an SSH client installed. Just, open the Terminal program.
If you are on Windows, download and install the PuTTY program.
If you are on Linux or another Unix derivative, you shouldn’t need my help. Go read something else.
The number used in these commands that starts with 192.yada.yada.yada
is the IP address of your My Cloud. It is the same one you typed in to login to the webpage earlier.
Note: In these command prompts, characters will not show up on the screen while typing passwords. Do not be alarmed, just type the password normally and press enter.
On Mac OS X, you will need to type ssh root@yourmycloudsIP
in your terminal you just opened. You will be given a warning about the host’s key. Type yes
and hit the enter key. At the password prompt, type welc0me
and hit enter.
On Windows, open the PuTTY program. At the box titled “Host Name (or IP address)” type your My Cloud’s IP address. Click Open at the bottom of the window. You will be presented with an alert about the host’s key. Click Yes. At the prompt “login as” type root
At “password” type welc0me
and hit the enter key.
You are now logged into SSH!
Before you start typing in random commands willy nilly, you should know that you are currently logged into the root account. SSH over the root account is HIGHLY discouraged in the Linux user community for security reasons, but unfortunately this is the only way WD has provided us to setup SSH.
First things first, you should change the root
password. Type passwd
and hit enter, You will now be given a prompt and then a verify prompt to change the root password. Store your chosen password somewhere securely.
Next, you should setup your My Cloud admin’s user account for SSH instead of continuing to use root
.
We need to add your user to the sudoers file so that you can run root commands when you want to, and safely run other commands as your normal user.
Type visudo
and hit enter. You should now see a text based editor program similar to notepad called nano
.
Use the arrow keys to move the cursor down to a new line below the one that says root ALL=(ALL) NOPASSWD: ALL
.
You must create a line for your user. Type yourusername ALL=(ALL) ALL
, where yourusername
is the username of your My Cloud’s admin. Now, to close and save the file hold down the CTRL key and press the x key. You will asked if you wish to save changes. Press the Y key for yes. Then, hit enter to save the file.
All other users apart from root are given by default a different shell by WD known as sh
. We don’t want this other shell. We want bash, the shell we were using as root.
To change your admin user’s shell, type chsh -s /bin/bash yourusername
where, once again yourusername
is the name of the admin user.
Finally, we want to allow the admin user to be able to login to SSH, but not the root
user anymore. We need to edit the sshd config file.
Type nano /etc/ssh/sshd_config
and use the arrow keys to scroll down to the line PermitRootLogin yes
. Change it to PermitRootLogin no
Next go to the line AllowUsers root
. Replace it with AllowUsers yourusername
CTRL-x, Y, and enter to save the file again.
Now you must restart the SSH server. Type service ssh restart
and then exit
to log out of the root account.
From now on, everytime you login you must use ssh yourusername@ipaddress
instead of root@ipaddress
. The password is the same one your admin user uses to login to the My Cloud’s webpage.
You must also preface any root privleged command you type with sudo
, and enter your password.
You are now logged into the My Cloud’s operating system and can run backups, edit services, create files, etc.
A few warnings to mind:
– Your usernames should never contain spaces or any funky non-alphanumeric characters. (Thanks @nnnn_mm)
– DO NOT, I REPEAT DO NOT use the apt-get upgrade
command. The modified Debian OS that your My Cloud runs is not a standard Linux distribution. Running this command WILL brick your device!
With that said, enjoy!