Author Topic: SSH Access  (Read 12632 times)

Gogoli

  • Calf
  • *
  • Posts: 14
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: 1128
  • 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: 14
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: 1128
  • 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: 14
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: 1128
  • 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: 14
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: 1128
  • 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: 14
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 »

davidcarlisuk

  • Calf
  • *
  • Posts: 4
Re: SSH Access
« Reply #9 on: September 27, 2021, 05:07:26 AM »
Useful topics discussions about SSH Access.