NextCloud and WM1 Account
Please find the following attachemnt for instructions
If we have added your public key to the server, so you should be able to log in and check. We will walk you through the process of copying your data to the server, ensuring the permissions are set correctly and accessing it via the browser. I have also included instructions on how to generate a new public key if you suspect the one you shared isn’t working.
Step 1: Verify SSH Access
To copy files to the server, you’ll use SSH (a secure way to connect to a remote computer). Your public key should already be set up, allowing you to log in to the server without a password.
- Open a Terminal:
o On a Mac: Open the "Terminal" app (search for it using Spotlight by pressing Command + Space and typing "Terminal").
o On Windows: Install and open a program like "Git Bash" or "Windows Terminal" (you can download Git Bash from https://git-scm.com/downloads if you don’t have it).
o On Linux: Open the terminal (usually found in your applications menu or by pressing Ctrl + Alt + T).
- Test SSH Login:
o Type the following command in the terminal and press Enter:
ssh <your_username>@wm1.ncra.tifr.res.in
o If your public key is set up correctly, you should log in without being asked for a password. You’ll see a prompt like <your_username>@wm1:~$.
o If you’re asked for a password or get an error (e.g., "Permission denied"), your public key may not be set up correctly. Follow Step 2 to generate and share a new public key.
- Exit the Server:
o After confirming you can log in, type exit and press Enter to return to your local terminal.
Step 2: Generate a New Public Key (If SSH Login Fails) in your Desktop
If you couldn’t log in, you may need to generate a new SSH key pair and share the public key with the server administrator. Follow these steps carefully:
- Check for Existing SSH Keys:
o In your terminal, type:
ls -al ~/.ssh
o This lists files in your SSH directory. Look for files named id_rsa (private key) and id_rsa.pub (public key). If they exist, skip to step 3. If not, proceed to generate a new key.
- Generate a New SSH Key:
o In the terminal, type:
ssh-keygen -t rsa
Press Enter when asked where to save the key (accept the default location: ~/.ssh/id_rsa).
o When prompted for a passphrase, press Enter twice to skip it (this makes it easier to use).
- View Your Public Key:
o Type the following to display your public key:
cat ~/.ssh/id_rsa.pub
o You’ll see a long string starting with ssh-rsa and ending with your email address. Copy this entire string (highlight it, right-click, and select "Copy").
o Email the copied public key to the server administrator (already added) and ask them to add it to the server. Mention that it’s for <your_username>@wm1.ncra.tifr.res.in. Do not share the private key (id_rsa).
- Test SSH Again:
o Once the administrator confirms they’ve added the key (already done), repeat the SSH login test from Step 1.
Step 3: Copy Files to the Server
You need to copy your files to the server at the path /data/pub/ncraftp/<your_username>/files/. You can use a tool called scp (secure copy) to do this. Here’s how:
- Locate Your Files:
o On your computer, find the folder containing the files you want to copy. For example, let’s say your files are in a folder called mydata on your Desktop.
- Copy Files Using SCP:
o In your terminal, navigate to the folder containing your files. For example:
cd ~/Desktop/mydata
o Then, copy the files to the server by typing:
scp -r * <your_username>@wm1.ncra.tifr.res.in:/data/pub/ncraftp/<your_username>/files/
o Explanation:
§ -r copies entire folders (if you’re copying a folder).
§ * means all files and folders in the current directory.
§ The destination is <your_username>@wm1.ncra.tifr.res.in:/data/pub/ncraftp/<your_username>/files/.
o You may see a progress bar as the files copy. Wait until it completes.
- Verify Files on the Server:
o Log in to the server again using:
ssh <your_username>@wm1.ncra.tifr.res.in
o Check the files by typing:
ls -tlrh /data/pub/ncraftp/<your_username>/files/
o You should see your files listed. If not, double-check the scp command and try again.
Step 4: Set Correct File Permissions
The files you copy must have the correct permissions so they can be accessed via the browser. The owner should be <your_username>, and the group should be apache. Here’s how to check and fix permissions:
- Check Current Permissions:
o While logged into the server (ssh <your_username>@wm1.ncra.tifr.res.in), type:
ls -tlrh /data/pub/ncraftp/<your_username>/files/
o The output should look something like:
drwxrwxr-x 2 <your_username> apache 10 Jun 2 18:11 mydata
o Explanation:
§ drwxrwxr-x: Permissions (owner and group have read/write/execute access).
§ <your_username>: The owner of the file/folder.
§ apache: The group assigned to the file/folder.
- Fix Permissions (If Needed):
o If the owner or group is incorrect, fix it by typing:
chown -R <your_username>:apache /data/pub/ncraftp/<your_username>/files/*
§ chown changes the owner and group.
§ -R applies the change to all files and folders inside the path.
§ <your_username>:apache sets the owner to <your_username> and the group to apache.
o Set the correct permissions (read/write/execute for owner and group):
chmod -R 775 /data/pub/ncraftp/<your_username>/files/*
§ chmod changes permissions.
§ 775 means the owner (<your_username>) and group (apache) can read, write, and execute, while others can only read and execute.
- Verify Permissions Again:
o Run the ls -tlrh command again to confirm the owner is <your_username> and the group is apache.
Step 5: Access Files via the Browser
After copying the files, it takes about 15 minutes for them to appear on the web interface.
- Open the Website:
o Open a web browser (e.g., Chrome, Firefox) and go to:
https://wm1.ncra.tifr.res.in
- Log In:
o Username: <your_username>
o Password: yourpassword
o If you can’t log in, double-check the username and password, or contact the administrator.
- Locate Your Files:
Step 6: Create and Share a Link
Once your files are visible in the browser, you can create a shareable link for collaborators outside NCRA.
o In the web interface (https://wm1.ncra.tifr.res.in), find your file or folder.
o Click the "Share" button (usually an icon with an arrow or a link symbol).
o Choose to create a public link. You may be able to set options like:
§ Password protection (optional).
§ Expiration date (optional).
o Copy the generated link.
o Send the link to your collaborators via email or another method. They can access the files using this link without needing an account.
- Learn More:
o For detailed instructions on sharing, visit:
https://wiki.ncra.tifr.res.in/books/documentation/page/nextcloud-and-wm1-account
Troubleshooting Tips
- SSH Login Fails:
- Ensure you’re using the correct username (<your_username>) and server (wm1.ncra.tifr.res.in).
- Generate and share a new public key (Step 2).
- Files Don’t Appear in Browser:
- Wait at least 15 minutes after copying.
- Verify permissions are set to <your_username>:apache (Step 4).
- Ensure you copied files to the correct path: /data/pub/ncraftp/<your_username>/files/.
- Permission Errors:
- Double-check the chown and chmod commands in Step 4.
If you follow these steps, you can copy your files, set permissions, and share them with collaborators.
No Comments