Author Topic: SSH Access  (Read 467 times)

Gogoli

  • Calf
  • *
  • Posts: 10
SSH Access
« on: August 18, 2020, 01:45:16 am »
Hi

I have a LinkSation 520D(Firmware version 4.50) and I was able to root access through ssh

I see the system files are read only and I can't do anything in it....cant install ipkg,cant install packages like text editors,can't create directories...ect

My question is how to install at least an text editor so after I will be able to edit an transmission web torrent file to be able to change the password because is empty...


« Last Edit: August 18, 2020, 02:01:25 am by Gogoli »

1000001101000

  • Debian Wizard
  • Big Bull
  • *****
  • Posts: 829
  • There's no problem so bad you cannot make it worse
Re: SSH Access
« Reply #1 on: August 18, 2020, 08:31:46 am »
The main operating system on this model is stored in a read-only filesystem contained in the device's on-board NAND flash which is why you're unable to make changes to it. The drives/raid arrays get mounted under /home, you can create directories and files there but by default they are mounted with the "noexec" option which prevents you from running code there.

There are a few different ways to work around these limitations, I've put together a short guide for running a full Debian install from a USB drive (alongside the stock firmware):
https://buffalonas.miraheze.org/wiki/Linkstation_LS520D#Custom_Firmware.2FOperating_System_installation

If you ever need a text editor on a Unix/Linux system (even something like a router) you'll find VI is installed basically everywhere.
http://www.atmos.albany.edu/daes/atmclasses/atm350/vi_cheat_sheet.pdf


Gogoli

  • Calf
  • *
  • Posts: 10
Re: SSH Access
« Reply #2 on: August 18, 2020, 11:51:24 am »
As you can see in the photo there isn't any editor installed!Maybe this is done on purpose for people to not be able to edit files

https://imgur.com/a/PBxeGfR


If I install full debian I will lose all configuration like samba,ftp ect

I don't get why there is be such a closed system....how I set a password for the trassmision web client witch has an empty password by default...this is crazy
« Last Edit: August 18, 2020, 11:57:00 am by Gogoli »

1000001101000

  • Debian Wizard
  • Big Bull
  • *****
  • Posts: 829
  • There's no problem so bad you cannot make it worse
Re: SSH Access
« Reply #3 on: August 18, 2020, 12:46:44 pm »
This type of Debian install doesn't actually replace anything, it just runs in the background. This also means you need to do somethings to be able to access your files from it. I can elaborate on that part more if you decide to give it a try.

To open vi use the following command:
Code: [Select]
vi
Part of why it works this way is to make it easier to use. By putting the OS in flash you can just insert drives and start using the system without having to go through a firmware install etc. There are also security advantages to doing things this way, the same things stopping you from running custom code stop random malware from running as well.

I agree with you though, I wish by default they (not just Buffalo) made devices easier to customize.

Gogoli

  • Calf
  • *
  • Posts: 10
Re: SSH Access
« Reply #4 on: August 18, 2020, 02:59:32 pm »
I tried the vi command but not working
I get "-bash: vi: command not found"

https://imgur.com/a/qaC3z9R

I can give you root details if you want to check

If I install the debian you are talking will I have the same web interface?

« Last Edit: August 18, 2020, 03:01:11 pm by Gogoli »

1000001101000

  • Debian Wizard
  • Big Bull
  • *****
  • Posts: 829
  • There's no problem so bad you cannot make it worse
Re: SSH Access
« Reply #5 on: August 18, 2020, 03:46:06 pm »
I'm surprised vi isn't there.

Maybe this will help make things more clear:
https://help.ubuntu.com/community/BasicChroot

The instructions I linked earlier describe how to install a compatible version of Debian on a USB drive which you can then connect to the device and run inside a chroot environment (see above). This way you don't need to make any real changes to the device's firmware but can run whatever programs you want.

Once you had that running you can install whatever editor you want to use.



Gogoli

  • Calf
  • *
  • Posts: 10
Re: SSH Access
« Reply #6 on: August 18, 2020, 04:01:36 pm »
They are doing everything for the system to not be customisable lol

Anyway the option you are talking seems to complicated for me and needs a lot of work as I have to first make a linux vm

I would pay something to you or someone else could do it over TV

I spent a lot of time to get root access and when I found out that was one line of code I was very angry lol

I have LS520D and is running 7.8 debian on latest firmware 4.50 .... *removed to not be leaked as might be fixed in a newer release of the firmware
« Last Edit: August 18, 2020, 04:43:44 pm by Gogoli »

1000001101000

  • Debian Wizard
  • Big Bull
  • *****
  • Posts: 829
  • There's no problem so bad you cannot make it worse
Re: SSH Access
« Reply #7 on: August 18, 2020, 04:38:39 pm »
I'm really impressed, I never noticed that ssh was even possible for that device. It took me an embarrassing amount of work to get telnet working (also on the wiki page).


Gogoli

  • Calf
  • *
  • Posts: 10
Re: SSH Access
« Reply #8 on: August 18, 2020, 04:53:10 pm »
I tried for the telnet but I failed
SSH was pretty easy.




Let me know if gou want to experiment with this NAS:)
« Last Edit: August 19, 2020, 12:02:41 am by Gogoli »